// ==UserScript== // @name Boite Outils // @version 2.24 // @namespace Boite Outils // @description Boite a outils, la boite qui sait tout faire ou presque. Par BeWorld // @resource URL_CASTLE_BUT http://i.imgur.com/MPlZr.png // @resource URL_CASTLE_BUT_SEL http://i.imgur.com/XWR4B.png // @resource URL_PROVINCE_MAP http://i.imgur.com/VE48b.png // @include *.kingdomsofcamelot.com/*main_src.php* // ==/UserScript== var Version = '2.24'; var nomonglet = "Boîte à outils"; var DEBUG_TRACE = false; var DEBUG_TRACE_DRAG = false; var MAP_DELAY = 1200; var miseajour = "Traduction, Adaptation, Ameliorations et creation par BeWorld - (Bases repris de PowerTools, merci a l'auteur)"; var URL_CASTLE_BUT = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAMAAAGkBsQ5AAABa1BMVEX%2F%2F8X%2F98X%2F973%2F97X%2F77X%2F7633773%2F76X377X3763%2F5q3%2F5qX%2F5pz35q335qX%2F3pz%2F3pT33pz%2F1pT%2F1oz%2F1oT31pT31oz%2FzoT%2Fznv3zoT%2FxXv%2FxXP%2FxWv3xXv3xXP%2FvWv%2FvWP3vWv3vWP%2FtWP%2FtVr%2FtVLmvWv3tWP3tVr3tVL%2FrVL%2FrUrmtWP3rVL3rUrvrVL%2FpUrvrUr%2FpULmrVrmrVL3pUr3pULmpUL3nDrepULWpVLWpUrmnDrFpUK1pVrOnDqcnFKcnEqMnEp7lHN7lGtzlGNrlGtjjEpajFpShFJSe2NChEJKe1o6hDohjDFCc1oZjDEhhDEQjDEAlDEpezoZhDEhezoQhDEAjDEpczoZezoIhDEhc0IhczoAhDEZczoIezEhazoAezEhY0IAczEAcykIazEhWkIAazEAaykIYzEhUkIAYzEAWjEAUjEAUikASjEASikAQjEAQikAOjEAOikAMTEAMSkAKSlOGAcLAAAACXBIWXMAAAsSAAALEgHS3X78AAABVklEQVQYGQXBPW4TYRiF0ee%2B3x2DRSxRIFJTGIkVUFDQIbEDlkE5%2B8kWWEKKIBSB5AohXBGUSAaCIdg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lAMcUmcKxspMWuOTJEDri0UHYr7ybBEqIQdP%2B%2FUALn13NcVZ8dW6iDpRNy2lQbgAFsvb6Ua5OotLvwigdwMlSNvTvH5xOjIYR4nTvs4dejLAUzXjh289t3bK3pvPV43d%2FTUr1OsPfG9c%2FXzv5uMDxP49%2Fu1AwIAOw%3D%3D"; var provMapCoords = {imgWidth:710, imgHeight:708, mapWidth:670, mapHeight:670, leftMargin:31, topMargin:19}; var classString; classString = '.attaquer {'; classString += 'margin-top:3px;background: url(http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg) no-repeat;'; classString += "}"; classString += '.reconnaissance {'; classString += 'margin-top:3px;background: url(http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg) no-repeat;'; classString += "}"; classString += '.retour {'; classString += 'margin-top:3px;background: url(http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg) no-repeat;'; classString += "}"; classString += '.transporter {'; classString += 'margin-top:3px;background: url(http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg) no-repeat;'; classString += "}"; classString += '.modalCurtain {'; classString += 'top:53px !important;'; classString += "}"; classString += '.modalBox {'; classString += 'top:53px !important;'; classString += "} "; // classString += ".noalliance { display:none !important; } "; var Style = document.createElement ('STYLE'); Style.setAttribute ('type', 'text/css'); Style.innerHTML = classString; document.body.appendChild (Style); // tabulation Alliance en bas : selectionner par defaut /*setTimeout(function() { unsafeWindow.directory_changetab(2); unsafeWindow.getDirectoryTabAllianceMembers(); unsafeWindow.track_chrome_btn('Directory_Alliance'); }, 5000); */ /**** FIN DES AMELIORATIONS *****/ var Options = { currentTab : 'Overview', currentTab2 : 'Overview1', includeMarching:true, EnableFormation:true, encRemaining : true, maxIdlePop : true, voirRaid : true, WhisperOn : false, AttaqueOn : false, // Permet de mettre un ptit son en cas de déecttion suir le chat d'une alerte d'attaque ! srcSortBy : 'level', EnableRefrechRapport : false, /// Permet le rafraichissement automatique des rapport alliance srcMinLevel : 1, srcMaxLevel : 7, Xrenfort : 0, PageReport : 1, Yrenfort : 0, filPuissance : 0, filPuissanceMax : 1000000, wildType : 1, citySrchFilter :0, unownedOnly : true, fixWarnZero : true, fixPageNav : true, mistedOnly : false, gmtClock : false, hostileOnly : false, fixTower : true, fixMapDistance: true, fixMsgCount : true, enhanceARpts : true, allowAlterAR : true, ptWinIsOpen : false, ptWin2IsOpen : false, ptWinDrag : true, ptWinPos : {}, ptWin2Pos : {}, enableFoodWarn : true, enableFoodWarnTchat : false, EnableReduireUnit: true, foodWarnHours : 24, chatEnhance : true, fixKnightSelect : true, attackCityPicker : true, mapCoordsTop : true, dispBattleRounds : true, reportDeleteButton : true, arPageFrom:1, arPageTo:2, rptType:'alliance', rptAuto:false, alertConfig : { aChat:true, aPrefix:'**** Je suis attaque !!! **', scouting:true, wilds:true, defence:true, minTroops:1, spamLimit:10, embassy:true, empennage:true, marechal:true, mytroops:true, food:true, defense:true, hq:'', sendEmail:false, emailAddress:'', token:'', sendasWhisper:false, sendtoAlly:true, showAttack: false, }, forceMarchUpdate : false, URLson1 : 'http://www.universal-soundbank.com/mp3/sounds/684.mp3', URLson2 : 'http://www.universal-soundbank.com/mp3/sounds/217.mp3', AttackHorloge: '21:00:00', AttackGoHorloge: null, AttackOnOff : false, AttackUnits : {}, AttackFromCity : 0, AttackCibleX : 0, AttackCibleY : 0, AttackKnight : 0, TournoiLigne : 25, }; var TrainOptions = { Running : false, list:{}, listactif:{}, listlabour:{}, timelauch:60, pourcpop:75, pourctot:95, unitemin:{}, listboost:{}, }; var JSON;if(!JSON){JSON={};}(function(){"use strict";function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}return str('',{'':value});};}if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}throw new SyntaxError('JSON.parse');};}}()); var JSON2 = JSON; var Cities = {}; var Seed = unsafeWindow.seed; var my = {}; var myBO = {}; var researchLevels = []; var crestname = {}; var mainPop, mainPop2; var Tabs = [ ['Overview', 'Résumé'], ['Rpt','Rapports'], ['Search', 'Chercher'], ['AllianceList' , 'Joueurs'], ['Marches', 'Marches'], ['TranspAuto', 'Transport'], ['Reassign', 'Réassigner'], ['Train' , 'Formation'], ['Knights' , 'Chevaliers'], ['Wilds' , 'Terres'], ['Options' , 'Options'], ]; var Tabs2 = [ ['Overview', 'Réserves'], ['Overview1', 'Armée'], ['Attaque', 'Attaquer'], ['autoFormation', 'Formation Auto'], ['Alliance', 'Alliance'], ['Crests', 'Armoiries'], ['Info' , 'Info'], ['Tournoi', 'Tournoi'], ['map', 'Carte'], ['Test', 'Test'] ]; var BOStartupTimer = null; ptStartupErrorTimer = null; var currentName = 'Overview'; var currentName2 = 'Overview1'; var myServerId = null; function getServerId() { if (myServerId == null){ var m=/^[a-zA-Z]+([0-9]+)\./.exec(document.location.hostname); if (m) myServerId = m[1]; else myServerId = '??'; } return myServerId; } function ptStartup (){ clearTimeout (BOStartupTimer); if (unsafeWindow.BOLoaded) return; var metc = getClientCoords(document.getElementById('main_engagement_tabs')); if (metc.width==null || metc.width==0){ BOStartupTimer = setTimeout (ptStartup, 1000); return; } unsafeWindow.BOLoaded = Version; readOptions(); readTrainingOptions (); Seed = unsafeWindow.seed; GM_addStyle ('.xtab {padding-right: 5px; border:none; background:none; white-space:nowrap;}\ .hostile td { background:crimson; }.friendly td{background:lightblue; }.ally td{background:royalblue; }\ .Hostile td { background:crimson; }.Friendly td{background:lightblue; }.Ally td{background:royalblue; }\ .neutral td { background:lightgreen; }.unaligned td { background:gold; }\ .Neutral td { background:lightgreen; }.Unaligned td { background:gold; }\ .xtabBR {padding-right: 5px; border:none; background:none;}\ div.ptDiv {background-color:#f0f0f0;}\ table.ptTab tr td {border:none; background:none; white-space:nowrap;}\ table.ptTabPad tr td {border:none; background:none; white-space:nowrap; padding: 2px 4px 2px 8px;}\ table.ptTabBR tr td {border:none; background:none;}\ table.ptTabLined tr td {border:1px none none solid none;}\ table.ptTabPad tr td.ptentry {background-color:#ffeecc; padding-left: 8px;}\ table.ptTabOverview tr td {border-left:1px solid #ccc; white-space:nowrap; padding: 1px; font-size:11px;}\ table.ptNoPad tr td {border:none; background:none; white-space:nowrap; padding:0px}\ .ptOddrow {background-color:#eee}\ .ptstat {border:1px solid; border-color:#ffffff; font-weight:bold; padding-top:2px; padding-bottom:2px; text-align:center; color:#ffffff; background-color:#357}\ .ptStatLight {color:#ddd}\ .ptentry {padding: 7px; border:1px solid; border-color:#000000; background-color:#ffeecc; white-space:nowrap;}\ .ptErrText {font-weight:bold; color:#600000}\ .castleBut {outline:0px; margin-left:0px; margin-right:0px; width:24px; height:26px; font-size:12px; font-weight:bold;}\ .castleBut:hover {border-size:3px; border-color:#000;}\ button::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { border: none; }\ .ptChatWhisper {}\ .ptChatAttack {color: #000; font-weight:bold; background-color: #FF7D7D; }\ .ptChatAlliance {}\ .ptChatGlobal {background-color: #fdd}\ .ptChatIcon {border: 2px inset blue}\ span.whiteOnRed {padding-left:3px; padding-right:3px; background-color:#700; color:white; font-weight:bold}\ span.boldRed {color:#800; font-weight:bold}\ span.oohfancy {color:#0000; font-weight:bold;text-shadow: 1px 1px 1px #AAA; font-variant:small-caps; text-align:center}\ span.oohfancyi {color:#0000; font-style:italic;text-shadow: 1px 1px 1px #AAA; font-variant:small-caps; text-align:center}\ .castleButNon {background-image:url("'+ URL_CASTLE_BUT +'")}\ .castleButSel {background-image:url("'+ URL_CASTLE_BUT_SEL +'")}\ span.boldDarkRed {color:#600; font-weight:bold}\ a.ptButton20 {color:#ffff80}\ input.bopbSubtab {cursor:pointer; width:10em; margin-right:15px;}\ input.bopbSubtabSel {background-color:#444444; color:white; font-weight:bold; cursor:none !important}\ matTab {}\ .matTabNotSel { padding:0 0 0 20px; color : #2F230E; font: bold 11px Georgia; white-space: nowrap; cursur:pointer; padding:0 0px 0 0;height: 17px; }\ .matTabNotSel span { background: url("http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/nav/tab_unselected.png") no-repeat scroll left 0 transparent; display: inline-block; height: 16px; padding: 1px 2px 0 7px; text-decoration: none; }\ .matTabSel { color : #2F230E; font: bold 11px Georgia; white-space: nowrap; cursur:pointer; padding:0 0px 0 0;height: 17px; }\ .matTabSel span { background: url("http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/nav/tab_selected.png") no-repeat scroll left top transparent; display: inline-block; height: 16px; padding: 1px 2px 0 7px; text-decoration: none; }\ tr.CPopupTop td { background-color:#dde; border:none; height: 15px; padding:0px; }\ .BOptretry_top { background-color:#a00; color:#fff; border:none; height: 21px; padding:0px; }\ input.ptButCancel {background-color:#a00; font-weight:bold; color:#fff}\ .id2_CPopupTop td { background-color:#ffffff;}\ .CPopup .CPopMain { background-color:#f8f8f8; padding:0px !important; }\ .CPopup .id2_CPopMain { background-color:#8ff; }\ .CPopup { border:3px ridge #666 }\ .idp2_CPopup { opacity:0.9; }\ idp1_CPopMain { padding:0px; }'); setCities(); if (Options.ptWinPos==null || Options.ptWinPos.x==null|| Options.ptWinPos.x=='' || isNaN(Options.ptWinPos.x)){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); Options.ptWinPos.x = c.x+4; Options.ptWinPos.y = c.y+c.height; saveOptions (); } if (Options.ptWin2Pos==null || Options.ptWin2Pos.x==null|| Options.ptWin2Pos.x=='' || isNaN(Options.ptWin2Pos.x)){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); Options.ptWin2Pos.x = c.x+4; Options.ptWin2Pos.y = c.y+c.height; saveOptions (); } if (Options.currentTab) { currentName = Options.currentTab; if (currentName=="Hud") { // test anti bug ! currentName="Rpt"; Options.currentTab=currentName; saveOptions (); } } else { currentName = 'Overview'; } if (Options.currentTab2) { currentName2 = Options.currentTab2; } else { currentName2 = 'Overview1'; } // Fenetre STATISTIQUES mainPop2 = new CPopup ('idp2', Options.ptWin2Pos.x, Options.ptWin2Pos.y, 779,350, true, function (){ myBO[currentName2].hide(); Options.ptWin2IsOpen=false; saveOptions(); }); var mainDiv2 = mainPop2.getMainDiv(); mainPop2.getTopDiv().innerHTML = '<TABLE cellspacing=0 width=100%><TR class=CPopupTop valign=bottom><TD><SPAN id=idTabs2></span></td><TD align=right>'+ Version +' </td></tr></table>'; mainPop2.autoHeight (true); mainPop2.autoWidth(true); var eTabs2 = document.getElementById('idTabs2'); for (k=0; k<Tabs2.length; k++){ var a=document.createElement('a'); a.id = 'ab'+ Tabs2[k][0]; a.innerHTML='<span id="spp'+ Tabs2[k][0] +'" class="matTab">'+ Tabs2[k][1] +'</span>'; eTabs2.appendChild(a); a.addEventListener('click', clickedTab2, false); myBO[Tabs2[k][0]].init(); cont = myBO[Tabs2[k][0]].getContent(); if (Tabs2[k][0]==currentName2) { cont.style.display = 'block'; //alert(currentName2 +' - ' +Tabs2[k][0]); a.className='matTabSel'; }else { cont.style.display = 'none'; a.className='matTabNotSel'; } mainDiv2.appendChild(cont); } // Fenetre BOITE A OUTILS mainPop = new CPopup ('idp1', Options.ptWinPos.x, Options.ptWinPos.y, 800,700, Options.ptWinDrag, function (){ my[currentName].hide(); Options.ptWinIsOpen=false; saveOptions() }); var mainDiv = mainPop.getMainDiv(); mainPop.getTopDiv().innerHTML = '<TABLE cellspacing=0 width=100%><TR class=CPopupTop valign=bottom><TD><SPAN id=idTabs></span></td><TD align=right style="font-size:11px"><span id=pthead_time>'+Version+'</span> </td></tr></table>'; mainPop.autoWidth(true); var eTabs = document.getElementById('idTabs'); for (k=0; k<Tabs.length; k++){ var a=document.createElement('a'); a.className='matTabNotSel'; a.id = 'aa'+ Tabs[k][0]; a.innerHTML='<span id="sp'+ Tabs[k][0] +'" class="matTab">'+ Tabs[k][1] +'</span>'; eTabs.appendChild(a); a.addEventListener('click', clickedTab, false); my[Tabs[k][0]].init(); cont = my[Tabs[k][0]].getContent(); if (Tabs[k][0]==currentName) { //alert(currentName +' - ' +Tabs[k][0]); cont.style.display = 'block'; a.className='matTabSel'; }else { cont.style.display = 'none'; a.className='matTabNotSel'; } mainDiv.appendChild(cont); } TowerAlerts.init(); AllianceReports.init (); messageNav.init(); FoodAlerts.init(); ChatStuff.init (); AttackDialog.init(); battleReports.init (); CoordBox.init (); MapDistanceFix.init (); WarnZeroAttack.init (); exportToKOCattackBO.init(); GMTclock.init (); if (Options.ptWin2IsOpen){ mainPop2.show (true); myBO[currentName2].show(); } if (Options.ptWinIsOpen){ mainPop.show (true); my[currentName].show(); } window.addEventListener('unload', onUnload, false); if (Options.fixTower) TowerAlerts.enableFixTarget(true); TowerAlerts.enableFixFalseReports(true); TowerAlerts.setPostToChatOptions(Options.alertConfig); AddMainTabLink2("Statistiques", eventHideShow2, mouseMainTab2); AddMainTabLink(nomonglet, eventHideShow, mouseMainTab); } function onUnload (){ Options.ptWinPos = mainPop.getLocation(); Options.ptWin2Pos = mainPop2.getLocation(); saveOptions(); } function getAlliance (aid){ if (Seed.allianceDiplomacies==null || Seed.allianceDiplomacies.allianceName==null) return ['Neutral', 0, 'None']; else if (Seed.allianceDiplomacies.friendly && Seed.allianceDiplomacies.friendly['a'+aid] != null) return ['friendly',Seed.allianceDiplomacies.allianceId, Seed.allianceDiplomacies.allianceName]; else if (Seed.allianceDiplomacies.hostile && Seed.allianceDiplomacies.hostile['a'+aid] != null) return ['hostile',Seed.allianceDiplomacies.hostile['a'+aid].allianceId, Seed.allianceDiplomacies.hostile['a'+aid].allianceName]; } var CoordBox = { init : function (){ var t = CoordBox; t.boxDiv = searchDOM (document.getElementById('maparea_map'), 'node.className=="mod_coord"', 3, false); t.setEnable (Options.mapCoordsTop); }, setEnable : function (tf){ var t = CoordBox; if (t.boxDiv == null) return; if (tf) t.boxDiv.style.zIndex = '100000'; else t.boxDiv.style.zIndex = '10011'; }, isAvailable : function (){ var t = CoordBox; return !(t.boxDiv==null); }, }; var battleReports = { init : function (){ var t = battleReports; t.getReportDisplayFunc = new CalterUwFunc ('getReportDisplay', [['return s.join("")', 'var themsg=s.join(""); themsg=getReportDisplay_hook(themsg, arguments[1]); return themsg']]); unsafeWindow.getReportDisplay_hook = t.hook; t.getReportDisplayFunc.setEnable (true); t.renderBattleReportFunc = new CalterUwFunc ('MarchReport.prototype.renderBattleReport', [['return k.join("")', 'var themsg=k.join(""); themsg=renderBattleReport_hook(themsg, this.rslt); return themsg']]); unsafeWindow.renderBattleReport_hook = t.hook2; t.renderBattleReportFunc.setEnable (true); t.renderButtonsFunc = new CalterUwFunc ('MarchReport.prototype.generateBackButton', [[/return \"(.*)\"/i, 'var msg="$1"; return battleReports_hook3(msg, this.rptid);']]); unsafeWindow.battleReports_hook3 = t.generateBackButtonHook; t.renderButtonsFunc.setEnable (true); unsafeWindow.deleteAreport = t.e_deleteReport; }, isRoundsAvailable : function (){ var t = battleReports; return t.getReportDisplayFunc.isAvailable(); }, isDeleteAvailable : function (){ var t = battleReports; return t.renderButtonsFunc.isAvailable(); }, generateBackButtonHook : function (msg, rptid){ if (!Options.reportDeleteButton) return msg; var delBut = msg.replace ('onclick=\'', 'onclick=\'deleteAreport('+ rptid +',false); '); delBut = delBut.replace (/<span>(.*)<\/span>/, '<span>'+ unsafeWindow.g_js_strings.commonstr.deletetx +'</span>'); return msg + delBut; }, e_deleteReport : function (rptid){ var t = battleReports; t.ajaxDeleteMyReport (rptid); }, ajaxDeleteMyReport : function (rptid, isUnread, side, isCityReport, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.s0rids = rptid; params.s1rids = ''; params.cityrids = ''; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/deleteCheckedReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok && isUnread){ unsafeWindow.seed.newReportCount = parseInt(unsafeWindow.seed.newReportCount) - 1; unsafeWindow.messages_notify_bug() } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, hook2 : function (msg, rslt){ if (rslt.rnds && Options.dispBattleRounds){ msg = msg.replace (/(Attaquants.*?<span.*?)<\/div>/im, '$1<BR>Rounds: '+ rslt.rnds +'</div>'); } return msg; }, hook : function (msg, rslt){ if (rslt.rnds && Options.dispBattleRounds){ msg = msg.replace (/(Attaquants <span.*?)<\/div>/im, '$1<BR>Rounds: '+ rslt.rnds +'</div>'); } return msg; }, } var ChatStuff = { chatDivContentFunc : null, getChatFunc : null, init : function (){ var t = ChatStuff; t.chatDivContentFunc = new CalterUwFunc ('Chat.chatDivContent', [['return e.join("");', 'var msg = e.join("");\n msg=chatDivContent_hook(msg);\n return msg;']]); unsafeWindow.chatDivContent_hook = t.chatDivContentHook; unsafeWindow.ptChatIconClicked = t.e_iconClicked; t.setEnable (Options.chatEnhance); }, isAvailable : function (){ var t = ChatStuff; t.chatDivContentFunc.isAvailable (); if(document.getElementById("mod_comm_list1")) { document.getElementById("mod_comm_list1").style.backgroundColor = '#99AADF'; } }, setEnable : function (tf){ var t = ChatStuff; t.chatDivContentFunc.setEnable (tf); }, e_iconClicked : function (name){ document.getElementById('mod_comm_input').value=''; var e = document.getElementById('mod_comm_input'); name = name.replace(/°°/g,"'"); e.value = '@'+ name +' '; e.focus(); }, chatDivContentHook : function (msg){ var t = ChatStuff; var classs = ''; var m = /div class='info'>.*<\/div>/im.exec(msg); if (m == null) return msg; var whisp = m[0]; if (m[0].indexOf('Type : ECLAIREUR') >= 0 || m[0].indexOf('Type : ATTAQUE') >= 0 || m[0].indexOf('Incoming Troops') >= 0) classs = 'ptChatAttack'; else if (m[0].indexOf('chuchote') >= 0) classs = 'ptChatWhisper'; else if (m[0].indexOf('to the alliance')>= 0 || m[0].indexOf("alliance:") >= 0) classs = 'ptChatAlliance'; else classs = 'ptChatGlobal'; msg = msg.replace ("class='content'", "class='content "+ classs +"'"); if (msg.indexOf('claimAllianceChat')<0){ msg = msg.replace (/([0-9]{1,3})\s*(,|-)\s*([0-9]{1,3})/img, '$1,$3'); } if (Options.WhisperOn && m[0].indexOf('te chuchote:')) { msg = msg.replace ("te chuchote:","<font size='1px' color=red> te murmure </font><div style='display:block;position:absolute;'><iframe src='"+Options.URLson1+"' frameborder=0 height=0 width=0></iframe></div>"); } if (Options.AttaqueOn && classs=='ptChatAttack' && m[0].indexOf(' ** ARRIVEE ** ')) { msg = msg.replace (" ** ARRIVEE ** "," *** ARRIVEE *** <div style='display:block;position:absolute;'><iframe src='"+Options.URLson2+"' frameborder=0 height=0 width=0></iframe></div>"); } var m = /(Lord|Lady) (.*?)</im.exec(msg); if (m != null) msg = msg.replace (/<img (.*?>)/img, '<A onclick=ptChatIconClicked(\"'+ m[2] +'\")><img class=\"ptChatIcon\" $1</a>'); return msg; }, } function displayReport (rptid, side){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.rid = rptid; params.side = side; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchReport.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); } var knightRoles = [ ['Contremaitre', 'politics', 'Pol'], ['Maréchal', 'combat', 'Com'], ['Alchimiste', 'intelligence', 'Int'], ['Régisseur', 'resourcefulness', 'Res'], ]; myBO.Tournoi = { cont:null, displayTimer : null, init : function (){ this.cont = document.createElement('div'); return this.cont; }, hide : function (){ var t = myBO.Tournoi; clearTimeout (t.displayTimer); }, getContent : function (){ var t = myBO.Tournoi; return t.cont; }, show : function () { var t = myBO.Tournoi; clearTimeout (t.displayTimer); t.cont.innerHTML = "<div class='tourny_modal_upsell'></div>"; var mhtl = "<table width=100%><tr><td colspan=8><center><b>Informations de base sur votre population et production</td></tr><tr><td></td>"; for(var i=0; i<Cities.numCities; i++) { //cityID = 'city'+ Cities.cities[i].id; //getTroopDefTrainEstimates(cityID); mhtl += "<TD align=center valign=bottom width=60px><B>" + Cities.cities[i].name.replace(/ /g, "<BR>").substr(0,10) + "</B></TD>"; } mhtl += "</tr><tr><td>Miliciens/h</td>"; var temps=[]; for(var i=0; i<Cities.numCities; i++) { temps[i]=((Cities.cities[i]['Troop2Time'] > 0)?(3600 / Cities.cities[i]['Troop2Time']):0); mhtl += "<td>" + addCommas(parseInt(temps[i])) +"</td>"; } mhtl += "</tr><tr><td>Population/h</td>"; var pop=[]; for(var i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; pop[i] = parseInt(Seed.citystats[cityID]["pop"][1]) / 2; mhtl += "<td>" + addCommas(parseInt(pop[i])) +"</td>"; } mhtl += "</tr><tr><td>Différence</td>"; var diff=0; for(var i=0; i<Cities.numCities; i++) { diff = parseInt(pop[i] - temps[i]); var couleur=" style='font-color:green' "; if (diff<0) couleur=" style='font-color:red' "; mhtl += "<td "+couleur+">" + addCommas(parseInt(diff)) +"</td>"; } mhtl += "</tr></table><br>"; t.cont.innerHTML += mhtl; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.format=2; params.tournyPos=0; new AjaxRequest(unsafeWindow.g_ajaxpath+"ajax/getLeaderboard.php"+unsafeWindow.g_ajaxsuffix, { method:"post", parameters:params, onSuccess:function(transport){ var rslt=eval("("+transport.responseText+")"); if(rslt.ok){ if(!rslt.data){ t.cont.innerHTML +="<div class='tourny_modal_upsell'>"+unsafeWindow.g_js_strings.modal_tourny_changetab.notourny+"</div>"; }else{ // fin rslt.data var tournyhtml=new Array(); if(rslt.name){ tournyhtml.push("<div><center><b><u>"+rslt.name.replace('The Tournament of Might','Tournoi de puissance individuel !')+"</u></b></center></div>") } else{ tournyhtml.push("<div class='tournymodaltitle'>"+unsafeWindow.g_js_strings.commonstr.tournament+"</div>") } tournyhtml.push("<div>"); if(rslt.startdate&&rslt.enddate){ var startTime=rslt.startdate; var endTime=rslt.enddate; var now=parseInt(new Date().getTime()/1000); tournyhtml.push("<table width=100% align=center><tr bgcolor=#FE8888><td width=40%><b>Début</td><td width=40%><b>Fin</td><td width=20%><b>Restant</td></tr>"); dt = new Date (); dt.setTime (startTime * 1000); dtf = new Date (); dtf.setTime (endTime * 1000); var restant = endTime - now; tournyhtml.push("<tr><td>"); tournyhtml.push("" + dt.toLocaleDateString() + " - "+ dt.toLocaleTimeString()); tournyhtml.push("</td><td>"); tournyhtml.push("" + dtf.toLocaleDateString()+ " - "+ dtf.toLocaleTimeString()); tournyhtml.push("</td><td>"+timestr(restant,1)+"</td></tr></table>"); tournyhtml.push("<br>"); } tournyhtml.push("<table class='tourny_list_table' cellpadding='0' cellspacing='0' border='0' style=''>"); tournyhtml.push("<thead>"); tournyhtml.push("<tr>"); if(rslt.type==24){ tournyhtml.push("<td class='rankcol' style='background-color:red'>"); tournyhtml.push("<div><input type=button id='BOTournoiPM' value='-'> "+unsafeWindow.g_js_strings.commonstr.ranking+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>unsafeWindow.g_js_strings.modal_tourny_changetab.chancellorname</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>"+unsafeWindow.g_js_strings.commonstr.alliance+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>"+unsafeWindow.g_js_strings.modal_tourny_changetab.mightgained+"</div>"); tournyhtml.push("</td style='background-color:red'>"); tournyhtml.push("<td style='background-color:red'> "); tournyhtml.push("<div>"+unsafeWindow.g_js_strings.modal_tourny_changetab.rewardperplayer+"</div>"); tournyhtml.push("</td>") }else{ tournyhtml.push("<td class='rankcol' style='background-color:red'>"); tournyhtml.push("<div><input type=button id='BOTournoiPM' value='-'> "+unsafeWindow.g_js_strings.commonstr.ranking+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>Nom Joueur</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>"+unsafeWindow.g_js_strings.commonstr.alliance.replace('Might Change','Puissance Prise')+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>"+rslt.contestcategory+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:red'>"); tournyhtml.push("<div>"+unsafeWindow.g_js_strings.commonstr.reward+"</div>"); tournyhtml.push("</td>") } tournyhtml.push("</tr>"); tournyhtml.push("</thead>"); tournyhtml.push("</tbody>"); var nb=rslt.data.length; var votrepuissance = 0; for(var i=0;i<rslt.data.length;i++){ var row=rslt.data[i]; if (Seed.player.prefix + ' '+ Seed.player.name == row.name ) { votrepuissance=row.contestValue; break; } } for(var i=0;i< Options.TournoiLigne;i++){ var row=rslt.data[i]; var rewardString=row.itemCount+" "; if(row.itemType==0){ rewardString+=unsafeWindow.g_js_strings.commonstr.gems; }else{ rewardString+=unsafeWindow.itemlist["i"+row.itemType].name; } var couleur=""; if (Seed.player.prefix + ' '+ Seed.player.name == row.name ) { couleur=" style='background-color:#77FF77' "; } if(i%2==1){ tournyhtml.push("<tr>") }else{ tournyhtml.push("<tr class='stripe'>") } tournyhtml.push("<td class='rankcol' "+couleur+">"); tournyhtml.push("<div><b>"+row.ranking+"</b></div>"); tournyhtml.push("</td>"); tournyhtml.push("<td "+couleur+">"); tournyhtml.push("<div>"+row.name+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td "+couleur+">"); tournyhtml.push("<div>"+(row.alliance||"----")+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td "+couleur+">"); tournyhtml.push("<div>"+addCommas(row.contestValue)); if (votrepuissance>0) { var ecartavecvous = parseInt(row.contestValue - votrepuissance); if (ecartavecvous>0) { tournyhtml.push(" (+ " + addCommas(ecartavecvous) +")"); } if (ecartavecvous<0) { tournyhtml.push(" (" + addCommas(ecartavecvous) +")"); } } tournyhtml.push("</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td "+couleur+">"); tournyhtml.push("<div>"+rewardString+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("</tr>") } // fin du for for(var i= Options.TournoiLigne;i<rslt.data.length;i++){ var row=rslt.data[i]; if (Seed.player.prefix + ' '+ Seed.player.name == row.name ) { var rewardString=row.itemCount+" "; if(row.itemType==0){ rewardString+=unsafeWindow.g_js_strings.commonstr.gems; }else{ rewardString+=unsafeWindow.itemlist["i"+row.itemType].name; } tournyhtml.push("<tr class='stripe' >") tournyhtml.push("<td class='rankcol' style='background-color:#77FF77'>"); tournyhtml.push("<div><b>"+row.ranking+"</b></div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:#77FF77'>"); tournyhtml.push("<div>"+row.name+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:#77FF77'>"); tournyhtml.push("<div>"+(row.alliance||"----")+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:#77FF77'>"); tournyhtml.push("<div>"+addCommas(row.contestValue)+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("<td style='background-color:#77FF77'>"); tournyhtml .push("<div>"+rewardString+"</div>"); tournyhtml.push("</td>"); tournyhtml.push("</tr>") } } tournyhtml.push("</tbody>"); tournyhtml.push("</table>"); tournyhtml.push("</div>"); t.cont.innerHTML += tournyhtml.join(""); document.getElementById('BOTournoiPM').addEventListener ('click', t.plusmoins, false); if (Options.TournoiLigne==25) { document.getElementById('BOTournoiPM').value="-"; } else { document.getElementById('BOTournoiPM').value="+"; } } // fin rslt.data } //rslt.ok else { t.cont.innerHTML = "<div class='tourny_modal_upsell'>Erreur de chargement</div>"; } }, onFailure:function() { t.cont.innerHTML = "<div class='tourny_modal_upsell'>Erreur de chargement</div>"; } }); t.displayTimer = setTimeout (t.show, 240000); }, plusmoins: function() { var t = myBO.Tournoi; if (document.getElementById('BOTournoiPM').value=="+") { document.getElementById('BOTournoiPM').value="-"; Options.TournoiLigne = 25; saveOptions(); } else { document.getElementById('BOTournoiPM').value="+"; Options.TournoiLigne = 5; } saveOptions(); clearTimeout (t.displayTimer); t.show(); }, }, /********************************* Reports Tab *************************************/ my.Rpt = { tabOrder: 90, tabLabel: 'Reports', cont: null, state: null, minPages: parseInt(Options.arPageFrom), maxPages: parseInt(Options.arPageTo), data: [], report: [], totalPages: parseInt(Options.arPageTo), what: '', whatNot: '', content: '', init : function (){ this.cont = document.createElement('div'); return this.cont; }, hide : function (){ }, getContent : function (){ var t = my.Rpt; return t.cont; }, show : function () { var t = my.Rpt; unsafeWindow.getmsg = t.getMailBody; unsafeWindow.DelMail = t.DeleteMail; unsafeWindow.getReport = t.getReportBody; unsafeWindow.DelReport = t.DeleteReport; var tc = '<DIV class=ptstat>RAPPORTS ALLIANCE - JOUEUR ET MESSAGERIE</DIV><DIV class=ptentry><TABLE><TR align=center valign=center>'; tc += '<TD class=xtab align=right>Type : <SELECT id="idRptType">'; tc += '<OPTION value="alliance" ' + (Options.rptType=='alliance'?'SELECTED':'') + '>Rapports de l\'alliance</OPTION>'; tc += '<OPTION value="player" ' + (Options.rptType=='player'?'SELECTED':'') + '>Rapports du joueur</OPTION>'; tc += '<OPTION value="inbox" ' + (Options.rptType=='inbox'?'SELECTED':'') + '>Boite reception</OPTION>'; tc += '<OPTION value="outbox" ' + (Options.rptType=='outbox'?'SELECTED':'') + '>Boite envoie</OPTION></SELECT>'; tc += '<BR /><INPUT id=idRptSearch type=submit value="Ok" /> Auto : <input type=checkbox id="idRptAuto" ' +(Options.RptAuto?'CHECKED':'')+'> Pages : <INPUT id="idRptPageFrom" size=1 value="' + Options.arPageFrom + '">–<INPUT id="idRptPageTo" size=1 value="' + Options.arPageTo + '"></TD>'; tc += '<TD class=xtab align=right>Attaquant : <SELECT id="idRptAttacker">'; // Options.arPageFrom - Options.arPageTo tc += '<OPTION value="Them" ' + (Options.arAttacker=='Them'?'SELECTED':'') + '>Eux</OPTION>'; tc += '<OPTION value="Us" ' + (Options.arAttacker=='Us'?'SELECTED':'') + '>Nous</OPTION>'; tc += '<OPTION value="Both" ' + (Options.arAttacker=='Both'?'SELECTED':'') + '>Les deux</OPTION></SELECT>'; tc += '<BR />Cible : <SELECT id="idRptTarget">'; tc += '<OPTION value="Them" ' + (Options.arTarget=='Them'?'SELECTED':'') + '>Eux</OPTION>'; tc += '<OPTION value="Us" ' + (Options.arTarget=='Us'?'SELECTED':'') + '>Nous</OPTION>'; tc += '<OPTION value="Both" ' + (Options.arTarget=='Both'?'SELECTED':'') + '>Les deux</OPTION></SELECT></TD>'; tc += '<TD class=xtab align=right>Contient: <INPUT id=idRptWhat type=text size=11 maxlength=50 value=""><BR />'; tc += 'Different : <INPUT id=idRptWhatNot type=text size=11 maxlength=50 value=""></TD>'; tc += '<TD class=xtab align=left><INPUT id=idRptAttack type=checkbox '+(Options.arAttack?'CHECKED':'')+' /> Attaque<BR />'; tc += '<INPUT id=idRptScout type=checkbox '+(Options.arScout?'CHECKED':'')+' /> Eclaireur</TD>'; tc += '<TD class=xtab align=left><INPUT id=idRptReinforce type=checkbox '+(Options.arReinforce?'CHECKED':'')+' /> Renfort<BR />'; tc += '<INPUT id=idRptTransport type=checkbox '+(Options.arTransport?'CHECKED':'')+' /> Transport</TD>'; tc += '<TD class=xtab align=left><select id=idRptFiltre1><option value="">--</option><option value="51">Ville</option><option value="0">TS</option></select></TD></TR></TABLE></DIV>'; tc += '<DIV class=ptstat><TABLE width=100% cellspacing=0><TR><TD class=xtab align=left width=125><DIV id=idRptSearched></DIV></TD></TD>'; tc += '<TD class=xtab><TD class=xtab align=center><SPAN style="white-space:normal" id=idRptStatus> </span></TD></TD>'; tc += '<TD class=xtab><TD class=xtab align=right width=125><DIV id=idRptFound></DIV></TD></TR></TABLE></DIV>'; tc += '<DIV id="idBoRptResultsDiv" style="height:556px; max-height:556px; overflow-x:auto; overflow-y:auto; white-space:nowrap;"></DIV>'; t.cont.innerHTML = tc; document.getElementById('idRptType').addEventListener ('change', t.handleRptType, false); document.getElementById('idRptPageFrom').addEventListener ('change', t.handleRptPages, false); document.getElementById('idRptPageTo').addEventListener ('change', t.handleRptPages, false); document.getElementById('idRptAttacker').addEventListener ('change', t.handleRptAttacker, false); document.getElementById('idRptTarget').addEventListener ('change', t.handleRptTarget, false); document.getElementById('idRptWhat').addEventListener ('keyup', t.handleRptWhat, false); document.getElementById('idRptWhatNot').addEventListener ('keyup', t.handleRptWhatNot, false); document.getElementById('idRptSearch').addEventListener ('click', t.handleRptSearch, false); document.getElementById('idRptFiltre1').addEventListener ('change', t.handleRptWhat, false); if (Options.RptAuto) t.handleRptSearch(); t.togOpt ('idRptAttack', 'arAttack'); t.togOpt ('idRptScout', 'arScout'); t.togOpt ('idRptReinforce', 'arReinforce'); t.togOpt ('idRptTransport', 'arTransport'); t.togOpt ('idRptAuto','RptAuto'); }, DeleteMail: function(rptid, type) { var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.requestType="ACTION_ON_MESSAGES"; params.selectedAction="delete"; params.boxType=document.getElementById('idRptType').value; params.selectedMessageIds=rptid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { t.handleRptSearch(); } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, DeleteReport: function(rptid, isUnread) { var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.s0rids = rptid; params.s1rids = ''; params.cityrids = ''; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/deleteCheckedReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { if (isUnread){ unsafeWindow.seed.newReportCount = parseInt(unsafeWindow.seed.newReportCount) - 1; unsafeWindow.messages_notify_bug() } t.handleRptSearch(); } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, togOpt: function (checkboxId, optionName){ var t = my.Rpt; var checkbox = document.getElementById(checkboxId); checkbox.addEventListener ('change', eventHandler, false); function eventHandler (){ Options[optionName] = this.checked; saveOptions(); if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); } }, handleRptType: function(){ var t = my.Rpt; Options.rptType = document.getElementById("idRptType").value; saveOptions(); document.getElementById("idRptSearched").innerHTML = ''; document.getElementById("idRptStatus").innerHTML = ' '; document.getElementById("idRptFound").innerHTML = ''; document.getElementById("idBoRptResultsDiv").innerHTML = ''; }, handleRptPages: function(){ var t = my.Rpt; t.minPages=parseInt(document.getElementById("idRptPageFrom").value); t.maxPages=parseInt(document.getElementById("idRptPageTo").value); if (t.maxPages < t.minPages) { t.maxPages = t.minPages; document.getElementById("idRptPageTo").value = t.maxPages; } Options.arPageFrom = t.minPages; Options.arPageTo = t.maxPages; saveOptions(); t.totalPages=t.maxPages; }, handleRptAttacker: function(){ var t = my.Rpt; Options.arAttacker = document.getElementById("idRptAttacker").value; saveOptions(); if ((Options.rptType == 'alliance' || Options.rptType == 'player') && t.data.length > 0) t.DisplayRpt(); }, handleRptTarget: function(){ var t = my.Rpt; Options.arTarget = document.getElementById("idRptTarget").value; saveOptions(); if ((Options.rptType == 'alliance' || Options.rptType == 'player') && t.data.length > 0) t.DisplayRpt(); }, handleRptWhat: function(){ var t = my.Rpt; t.what = document.getElementById("idRptWhat").value; if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, handleRptWhatNot: function(){ var t = my.Rpt; t.whatNot = document.getElementById("idRptWhatNot").value; if (t.data.length > 0) if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, handleRptSearch: function(){ var t = my.Rpt; if (t.searchRunning){ t.searchRunning = false; t.stopSearch ('RECHERCHE ANNULEE !'); return; } t.handleRptPages(); document.getElementById ('idRptSearch').value = 'Stop'; document.getElementById('idRptStatus').innerHTML = 'Recherche en cours page ' + t.minPages + ' sur ' + t.maxPages; t.searchRunning = true; t.data=[]; t.report = []; if (Options.rptType == 'alliance' || Options.rptType == 'player') t.getRpt(t.minPages); else t.getMail(t.minPages); }, stopSearch: function (msg){ var t = my.Rpt; if (t.searchRunning || msg == 'RECHERCHE ANNULEE !') document.getElementById ('idRptStatus').innerHTML = '<FONT color=#ffaaaa>' + msg + '</FONT>'; document.getElementById ('idRptSearch').value = 'Ok'; t.searchRunning = false; if (Options.rptType == 'alliance' || Options.rptType == 'player') t.DisplayRpt(); else t.DisplayMail(); }, getMail: function (pageNum){ var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf=0; params.requestType="GET_MESSAGE_HEADERS_FOR_USER_INBOX"; params.boxType = document.getElementById('idRptType').value; params.pageNo = pageNum; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.getMailCallback(rslt, pageNum); }, onFailure: function () { }, }, false); }, getMailCallback: function(rslt, page) { var t = my.Rpt; if (rslt) { if (!rslt.ok) { document.getElementById("idRptStatus").innerHTML = '<FONT color=#ffaaaa>' + rslt.errorMsg + '</FONT>'; return; } t.totalPages=parseInt(rslt.noOfPages); if (t.totalPages < t.maxPages) t.maxPages = t.totalPages; if (rslt.message && page) { var ml = rslt.message; if (rslt.messageCount > 0) { var rptkeys = unsafeWindow.Object.keys(ml); for (var i = 0; i < rptkeys.length; i++) { var rpt = ml[rptkeys[i]]; rpt.page = page; t.data.push(rpt); } } } if (parseInt(page)+1 <= t.maxPages && t.searchRunning) { document.getElementById("idRptStatus").innerHTML = 'Recherche en cours page ' + (parseInt(page)+1) + ' sur ' + t.maxPages; t.getMail(parseInt(page)+1); if (t.data.length > 0) t.DisplayMail(); } else if (page) t.stopSearch ('Fini !'); } }, getRpt: function (pageNum){ var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = pageNum; if (Options.rptType == 'alliance') params.group = "a"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/listReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt){ t.getRptCallback (rslt, pageNum); }, onFailure: function (rslt){ t.getRptCallback (rslt, pageNum); }, }, false); }, getRptCallback: function(rslt, page){ var t = my.Rpt; if (rslt) { if (!rslt.ok) { document.getElementById("idRptStatus").innerHTML = '<FONT color=#ffaaaa>' + rslt.errorMsg + '</FONT>'; return; } t.totalPages=parseInt(rslt.totalPages); if (t.totalPages < t.maxPages) t.maxPages = t.totalPages; if (rslt.arReports && page) { var ar = rslt.arReports; if (ar.length == 0) t.stopSearch('Page vide trouve depuis la page ' + page + ' - Kabam glitch'); var rptkeys = unsafeWindow.Object.keys(ar); for (var i = 0; i < rptkeys.length; i++) { var rpt = ar[rptkeys[i]]; var reportId = parseInt(rpt.reportId); t.report[reportId] = []; t.report[reportId].side1Name = rslt.arPlayerNames['p'+rpt.side1PlayerId]; t.report[reportId].side1AllianceId = parseInt(rpt.side1AllianceId); if (rpt.side1AllianceId > 0) t.report[reportId].side1AllianceName = rslt.arAllianceNames['a'+rpt.side1AllianceId]; else t.report[reportId].side1AllianceName = '-'; if (rpt.side1CityId > 0) t.report[reportId].side1CityName = rslt.arCityNames['c'+rpt.side1CityId]; else t.report[reportId].side1CityName = '-'; t.report[reportId].side1XCoord = rpt.side1XCoord; t.report[reportId].side1YCoord = rpt.side1YCoord; if (parseInt(rpt.side0PlayerId) == 0) { // Kabam t.report[reportId].side0Name = 'Enemi'; t.report[reportId].side0AllianceName = ''; t.report[reportId].side0CityName = ''; } else { t.report[reportId].side0Name = rslt.arPlayerNames['p'+rpt.side0PlayerId]; if (rpt.side0AllianceId > 0) t.report[reportId].side0AllianceName = rslt.arAllianceNames['a'+rpt.side0AllianceId]; else t.report[reportId].side0AllianceName = '-'; if (rpt.side0CityId > 0) t.report[reportId].side0CityName = rslt.arCityNames['c'+rpt.side0CityId]; else t.report[reportId].side0CityName = '-'; } t.report[reportId].side0AllianceId = parseInt(rpt.side0AllianceId); t.report[reportId].side0XCoord = rpt.side0XCoord; t.report[reportId].side0YCoord = rpt.side0YCoord; if (parseInt(rpt.side0TileType) == 10) t.report[reportId].side0TileTypeText='Prair'; else if (parseInt(rpt.side0TileType) == 11) t.report[reportId].side0TileTypeText='Lac'; else if (parseInt(rpt.side0TileType) == 20) t.report[reportId].side0TileTypeText='Fore'; else if (parseInt(rpt.side0TileType) == 30) t.report[reportId].side0TileTypeText='Coll'; else if (parseInt(rpt.side0TileType) == 40) t.report[reportId].side0TileTypeText='Mont'; else if (parseInt(rpt.side0TileType) == 50) t.report[reportId].side0TileTypeText='Plai'; else if (parseInt(rpt.side0CityId) ==0) t.report[reportId].side0TileTypeText='Barb'; else t.report[reportId].side0TileTypeText='Vil'; t.report[reportId].side0TileTypeLevel = t.report[reportId].side0TileTypeText + ' ' + rpt.side0TileLevel; t.report[reportId].side0TileType = rpt.side0TileType; t.report[reportId].side0TileLevel = rpt.side0TileLevel; t.report[reportId].page = page; t.report[reportId].reportUnixTime = rpt.reportUnixTime; if (rpt.side0AllianceId == parseInt(getMyAlliance()[0])) t.report[reportId].sideId = 0; else if (rpt.side1AllianceId == parseInt(getMyAlliance()[0])) { t.report[reportId].sideId = 1; } else { // if we're here then this is a player report from when they were in another alliance if (rpt.side0PlayerId == getMyUserId()) t.report[reportId].sideId = 0; else if (rpt.side1PlayerId == getMyUserId()) t.report[reportId].sideId = 1; else // shouldn't get here but we'll catch it if the report body is requested t.report[reportId].sideId = -1; } if (rpt.marchType == 0) t.report[reportId].marchName = 'Desertion'; else if (rpt.marchType == 1) t.report[reportId].marchName = 'Transport'; else if (rpt.marchType == 2) t.report[reportId].marchName = 'Renfort'; else if (rpt.marchType == 3) { if (t.report[reportId].sideId == 0) t.report[reportId].marchName = 'Contre-Ecl'; else t.report[reportId].marchName = 'Eclaireur'; } else if (rpt.marchType == 4) { if (t.report[reportId].sideId == 0) t.report[reportId].marchName = 'Defense'; else t.report[reportId].marchName = 'Attaque'; } else t.report[reportId].marchName = '?'; t.data.push ({ reportId: reportId, }); } } if (parseInt(page)+1 <= t.maxPages && t.searchRunning) { document.getElementById("idRptStatus").innerHTML = 'Recherche en cours de la page ' + (parseInt(page)+1) + ' sur ' + t.maxPages; t.getRpt(parseInt(page)+1); if (t.data.length > 0) t.DisplayRpt(); } else if (page) t.stopSearch ('Fini !'); } }, DisplayMail: function (){ var t = my.Rpt; var results = document.getElementById("idBoRptResultsDiv"); if(!t.data.length) { results.innerHTML = '<center>Aucun resultat</center>'; return; } reportsSearched = t.data.length; reportsFound = 0; t.content = ''; for (var i=0; i<reportsSearched;i++) { var rpt = t.data[i]; if ((t.what == '' || (rpt.subject.search(t.what, "i") != -1) || (rpt.displayName.search(t.what, "i") != -1)) && (t.whatNot == '' || ((rpt.subject.search(t.whatNot, "i") == -1) && (rpt.displayName.search(t.whatNot, "i") == -1)))) { if (rpt.subject == '') rpt.subject = '<Sans Sujet>'; reportsFound++; if (reportsFound == 1) t.content += '<center><table><thead><th>P</th><th>Date</th><th>De</th><th>Sujet</th><th>Sup</th></thead><tbody>'; var stylee=""; if (rpt.messageRead==0) stylee=' style="background-color:#CCCCCC;"'; t.content += '<tr><td align=right '+stylee+'>'+rpt.page+'</td><td '+stylee+'>'+rpt.dateSent+'</td><td '+stylee+'>'+rpt.displayName+'</td>'; t.content += '<td '+stylee+'><A><SPAN onclick="getmsg('+ rpt.messageId +')">' + rpt.subject + '</SPAN></a></td><td><a onclick="DelMail('+ rpt.messageId +');"><img src="http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png" border=0 title="Supprimer ce message"></a></td></tr>'; } } if (reportsFound > 1) t.content += '</tbody></table></center>'; if (reportsFound == 0 && reportsSearched > 0) t.content = '<center>Aucun resultat</center>'; results.innerHTML = t.content; document.getElementById("idRptSearched").innerHTML = ' Resultat : ' + reportsSearched; document.getElementById("idRptFound").innerHTML = 'Trouve : ' + reportsFound; }, getMailBody: function(ID,dataI){ var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.messageId=ID; params.requestType="GET_MESSAGE_FOR_ID"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) t.displayMailBody(rslt.messageBody); }, onFailure: function () {}, }, false); }, displayMailBody: function (messageBody) { var t = my.Rpt; //var popMsg = null; if (t.popMsg == null) { t.popMsg = new CPopup('pbMailBody', 0, 0, 670, 500, true, function() {clearTimeout (1000);}); t.popMsg.centerMe (mainPop.getMainDiv()); } var m = '<DIV style="max-height:465px; height:465px; overflow-y:scroll">'; m+= messageBody + '</div>'; t.popMsg.getMainDiv().innerHTML = m; t.popMsg.getTopDiv().innerHTML = '<DIV align=center><B>Messagerie</B></DIV>'; t.popMsg.show(true); }, DisplayRpt: function (){ var t = my.Rpt; var results = document.getElementById("idBoRptResultsDiv"); if(!t.data.length) { results.innerHTML = '<center>Aucun resultat</center>'; return; } var myAllianceId = parseInt(getMyAlliance()[0]); reportsSearched = t.data.length; reportsFound = 0; t.content = ''; for (var i=0; i<reportsSearched;i++) { var reportId = t.data[i].reportId; var rpt = t.report[reportId]; if ((rpt.side0Name=='undefined') && (rpt.marchName != 'Desertion')) continue; if ((((myAllianceId == parseInt(rpt.side1AllianceId) && Options.arAttacker != 'Them') || (myAllianceId != parseInt(rpt.side1AllianceId) && Options.arAttacker != 'Us') || Options.arAttacker == 'Both') && ((myAllianceId == parseInt(rpt.side0AllianceId) && Options.arTarget != 'Them') || (myAllianceId != parseInt(rpt.side0AllianceId) && Options.arTarget != 'Us') || Options.arTarget == 'Both') && ((Options.arAttack && (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense')) || (Options.arScout && (rpt.marchName == 'Contre-Ecl' || rpt.marchName == 'Eclaireur')) || (Options.arReinforce && rpt.marchName == 'Renfort') || (Options.arTransport && rpt.marchName == 'Transport'))) || (rpt.marchName == 'Desertion')) { if (((t.what == '' || (rpt.side1Name.search(t.what, "i") != -1) || (rpt.side1AllianceName.search(t.what, "i") != -1) || (rpt.side0Name.search(t.what, "i") != -1) || (rpt.side0AllianceName.search(t.what, "i") != -1) || (rpt.side0TileTypeText.search(t.what, "i") != -1)) && (t.whatNot == '' || ((rpt.side1Name.search(t.whatNot, "i") == -1) && (rpt.side1AllianceName.search(t.whatNot, "i") == -1) && (rpt.side0Name.search(t.whatNot, "i") == -1) && (rpt.side0AllianceName.search(t.whatNot, "i") == -1) && (rpt.side0TileTypeText.search(t.whatNot, "i") == -1)))) || (rpt.marchName == 'Desertion')) { if ((document.getElementById("idRptFiltre1").value=="") || (rpt.side0TileType==51 && document.getElementById("idRptFiltre1").value==51) || (rpt.side0TileType>0 && rpt.side0TileType<51 && document.getElementById("idRptFiltre1").value==0)) { reportsFound++; if (reportsFound == 1) { if (Options.enableReportNumber) t.content += '<center><table class=ptTabOverview width=100% cellspacing=0 cellpadding=3><thead><th>P</th><th>R.</th><th>Date</th><th>Rapport</th><th>Attaquants</th><th>De</th>'; else t.content += '<center><table class=ptTabOverview width=100% cellspacing=0 cellpadding=3><thead><th>P</th><th>R.</th><th>Date</th><th>Attaquant</th><th>De</th>'; if (Options.arAttacker != 'Us') t.content += '<th>Alliance</th>'; t.content += '<th>Action</th><th>Cible</th><th>A</th>'; if (Options.arTarget != 'Us') t.content += '<th>Alliance</th>'; t.content += '<th>Type</th><th><span title="Ville la plus proche">VP</span></th><th><span title="Distance de la ville la plus proche">D</span></th></thead><tbody>'; } var closestDist=999999; var closestLoc=null; var closestNum=1; for (var c=0; c<Cities.numCities; c++){ var city = Cities.cities[c]; city.x +','+ city.y var dist=distance(city.x,city.y,rpt.side0XCoord,rpt.side0YCoord); if(dist<closestDist) { closestDist=dist; closestLoc=city.x +','+ city.y; closestNum=c+1; } } if (rpt.marchName == 'Contre-Ecl' || rpt.marchName == 'Defense') style=' style="background-color:#EF9999;"'; else if (rpt.marchName == 'Renfort') style=' style="background-color:#99EF99;"'; else style=""; t.content += '<tr><td align=right '+style+'>'+rpt.page+'</td><td align=right '+style+'><a onclick="getReport('+ reportId+')"><img border=0 src="http://cdn1.iconfinder.com/data/icons/woothemesiconset/16/search_button.png"></a>'; if (rpt.side0Name==Seed.player.name || rpt.side1Name==Seed.player.name) { t.content +=' <a onclick="DelReport('+ reportId +', false);"><img src="http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png" border=0 title="Supprimer mon rapport"></a>'; } t.content += '</td><td '+style+'>'+formatUnixTime(rpt.reportUnixTime,'24hour')+'</td>'; if (Options.enableReportNumber) t.content += '<td '+style+'>' + reportId + '</td>'; if (rpt.marchName == 'Desertion') { t.content += '<td '+style+'></td><td '+style+'></td>'; if (Options.arAttacker != 'Us') t.content += '<td '+style+'></td>'; t.content += '<td '+style+'>'+rpt.marchName+'</td><td '+style+'></td><td '+style+'></td><td '+style+'></td>'; if (Options.arAttacker != 'Us') t.content += '<td '+style+'></td>'; t.content += '<td '+style+'></td><td '+style+'></td>'; } else { t.content += '<td '+style+'><span title="'+rpt.side1Name+'">'+rpt.side1Name.substring(0,12)+'</span></td><td align=center '+style+'><a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side1XCoord +','+ rpt.side1YCoord +')</a></td>'; if (Options.arAttacker != 'Us') t.content += '<td '+style+'><span title="'+rpt.side1AllianceName+'">'+rpt.side1AllianceName.substring(0,17)+'</span></td>'; if (rpt.marchName == 'Contre-Ecl' || rpt.marchName == 'Eclaireur') t.content += '<TD '+style+'><FONT color="FF8822">'+rpt.marchName+'</font></td>'; else if (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense') t.content += '<TD '+style+'><FONT color="FF1122">'+rpt.marchName+'</font></td>'; else if (rpt.marchName == 'Renfort') t.content += '<TD '+style+'><FONT color="339933">'+rpt.marchName+'</font></td>'; else t.content += '<TD '+style+'>'+rpt.marchName+'</td>'; //t.content += '<td>'+rpt.marchName+'</td>'; t.content += '<td '+style+'><span title="'+rpt.side0Name+'">'+rpt.side0Name.substring(0,12)+'</span></td>'; t.content += '<td align=center '+style+'><a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side0XCoord +','+ rpt.side0YCoord +')</a></td>'; if (Options.arTarget != 'Us') t.content += '<td '+style+'><span title="'+rpt.side0AllianceName+'">'+rpt.side0AllianceName.substring(0,17)+'</span></td>'; t.content += '<td '+style+'>'+rpt.side0TileTypeLevel+'</td><td align=center '+style+'><A onclick=\"citysel_click(document.getElementById(\'citysel_'+ (closestNum)+'\'));\">' + closestLoc + '</a></td><td align=right '+style+'>'+Math.floor(closestDist)+'</td></tr>'; } } } } } if (reportsFound > 1) t.content += '</tbody></table></center>'; if (reportsFound == 0 && reportsSearched > 0) t.content = '<center>Aucun resultat</center>'; results.innerHTML = t.content; document.getElementById("idRptSearched").innerHTML = ' Resultat : ' + reportsSearched; document.getElementById("idRptFound").innerHTML = 'Trouve : ' + reportsFound; }, getReportBody: function(reportId){ var t = my.Rpt; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.rid=reportId; params.side=t.report[reportId].sideId; if (params.side > -1) { new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchReport.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.displayReportBody(rslt,reportId); }, onFailure: function (rslt) {}, }, false); } else { unsafeWindow.alert ('Could not determine which side of the report to view - please send details to the developer'); } }, displayReportBody: function (rslt, reportId) { var t = my.Rpt; var popReport = null; var rpt = t.report[reportId]; var m = ''; var unitImg = []; for (var i=1;i<13;i++) unitImg[i] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+i+'_30.png></TD><TD>' + unsafeWindow.unitcost['unt'+i][0]; unitImg[53] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_53_30.png></TD><TD>Arbalètes'; unitImg[55] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_55_30.png></TD><TD>Trebuchet'; unitImg[60] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_60_30.png></TD><TD>Piège'; unitImg[61] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_61_30.png></TD><TD>Chausse-trappes'; unitImg[62] = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_62_30.png></TD><TD>Palissades'; goldImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_30.png></TD><TD>Or'; foodImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png></TD><TD>Nourriture'; woodImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png></TD><TD>Bois'; stoneImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png></TD><TD>Pierre'; oreImg = '<img src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png></TD><TD>Minerais'; function buildHeader () { var h='<TABLE class=ptTab width=100%>'; h+='<TR valign=top><TD align=left width=10%><B>'; if (rpt.marchName == 'Contre-Ecl' || rpt.marchName == 'Eclaireur') h+="Lieu " + rpt.marchName+' '; else if (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense') h+='Lieu de Bataille '; else if (rpt.marchName == 'Renfort' || rpt.marchName == 'Transport') h+=rpt.marchName+' depuis<BR />'+rpt.marchName+' vers</B>'; if (rpt.side0TileTypeText == 'Barb') h+=' Camp Barbare Niveau ' + rpt.side0TileLevel; else if (rpt.side0TileTypeText != 'Ville') h+=' '+rpt.side0TileTypeText+' Niveau '+ rpt.side0TileLevel+' '; h+='</B></TD>'; if (rpt.marchName == 'Renfort' || rpt.marchName == 'Transport') { h+='<TD align=left width=1%>'; if (Seed.player.name != rpt.side1Name) h+=rpt.side1Name; if (Seed.player.name != rpt.side0Name) h+='<BR />'+rpt.side0Name; h+='</TD>'; } h+='<TD align=left width=5%>'; if (rpt.marchName == 'Renfort' || rpt.marchName == 'Transport') h+='<a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side1XCoord +','+ rpt.side1YCoord +')</a><BR />'; h+='<a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side0XCoord +','+ rpt.side0YCoord +')</a></TD>'; if (rpt.side0TileTypeText != 'Ville' && rpt.side0TileTypeText != 'Barb' && (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense')) { if (rslt['conquered']==1) h+='<TD><FONT color="#CC0000"><B>Conquis</B></font></td>'; else if (rslt['conquered']==0) h+='<TD><FONT color="#66CC33"><B>Sécurisé</B></font></td>'; } else if (rpt.marchName == 'Renfort' || rpt.marchName == 'Transport') { h+='<TD align=left width=5%>'+rpt.side1CityName+'<BR />'; if (rpt.side0CityName != '') h+=rpt.side0CityName+'</TD>'; else h+=rpt.side0TileTypeText+' Niveau '+ rpt.side0TileLevel+'</TD>'; } h+='<TD align=right>' + formatUnixTime(rpt.reportUnixTime,'24hour') + '<BR />Rapport No: ' + reportId + '</TD></TR></TABLE>'; return h; } function handleunts () { // Troops sent to Reinforce or troops found on a Scout var hunts = '', th = '', tc = '', tf = ''; if (rslt['unts'] != undefined) { if (rpt.marchName == 'Renfort') th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Renforts Envoyés</TH></TR>'; else if (rslt['unts']['u1'] != undefined || rslt['unts']['u2'] != undefined || rslt['unts']['u3'] != undefined || rslt['unts']['u4'] != undefined || rslt['unts']['u5'] != undefined || rslt['unts']['u6'] != undefined || rslt['unts']['u7'] != undefined || rslt['unts']['u8'] != undefined || rslt['unts']['u9'] != undefined || rslt['unts']['u10'] != undefined || rslt['unts']['u11'] != undefined || rslt['unts']['u12'] != undefined) th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Troupes</TH></TR>'; for (var i=1;i<13;i++) if (rslt['unts']['u'+i] != undefined) tc+='<TR><TD>' + unitImg[i] + '</TD><TD align=right>'+addCommas(rslt['unts']['u'+i])+'</TD></TR>'; tf='</TABLE>'; } if (tc != '') hunts = th + tc + tf; return hunts; } function handlersc () { // Resources brought with reinforcements or found on a Scout var hrsc = '', th = '', tc = '', tf = ''; if (rslt['rsc'] != undefined) { if (rslt['rsc']['r1'] > 0 || rslt['rsc']['r2'] > 0 || rslt['rsc']['r3'] > 0 || rslt['rsc']['r4'] > 0) { if (rpt.marchName == 'Renfort') th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Ressources Envoyées</TH></TR>'; else { th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Ressources</TH></TR>'; if (rslt['gld'] > 0) tc+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommasInt(rslt['gld'])+'</TD></TR>'; } if (rslt['rsc']['r1'] > 0) tc+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r1'])+'</TD></TR>'; if (rslt['rsc']['r2'] > 0) tc+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r2'])+'</TD></TR>'; if (rslt['rsc']['r3'] > 0) tc+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r3'])+'</TD></TR>'; if (rslt['rsc']['r4'] > 0) tc+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommasInt(rslt['rsc']['r4'])+'</TD></TR>'; tf='</TABLE>'; } } if (tc != '') hrsc = th + tc + tf; return hrsc; } function handlefrt () { // Fortifications found on a Scout var hfrt = '', th = '', tc = '', tf = ''; if (rslt['frt'] != 'undefined') { if (rslt['frt']['f53'] != undefined || rslt['frt']['f55'] != undefined || rslt['frt']['f60'] != undefined || rslt['frt']['f61'] != undefined || rslt['frt']['f62'] != undefined) { th='<TABLE class=ptTab><TR><TH colspan=3 align=left>Défenses</TH></TR>'; if (rslt['frt']['f53'] != undefined) tc+='<TR><TD>' + unitImg[53] + '</TD><TD align=right>'+addCommas(rslt['frt']['f53'])+'</TD></TR>'; if (rslt['frt']['f55'] != undefined) tc+='<TR><TD>' + unitImg[55] + '</TD><TD align=right>'+addCommas(rslt['frt']['f55'])+'</TD></TR>'; if (rslt['frt']['f60'] != undefined) tc+='<TR><TD>' + unitImg[60] + '</TD><TD align=right>'+addCommas(rslt['frt']['f60'])+'</TD></TR>'; if (rslt['frt']['f61'] != undefined) tc+='<TR><TD>' + unitImg[61] + '</TD><TD align=right>'+addCommas(rslt['frt']['f61'])+'</TD></TR>'; if (rslt['frt']['f62'] != undefined) tc+='<TR><TD>' + unitImg[62] + '</TD><TD align=right>'+addCommas(rslt['frt']['f62'])+'</TD></TR>'; tf='</TABLE>'; } } if (tc != '') hfrt = th + tc + tf; return hfrt; } function handleblds (bType) { var blds = rslt['blds']['b'+bType]; b = '<TR><TD>'; arField = [], firstbld = true; if (bType == 1) b+='Ferme'; else if (bType == 2) b+='Scierie'; else if (bType == 3) b+='Carriè'; else if (bType == 4) b+='Mine'; b+='</TD><TD>'; for (var i=1; i<12; i++) arField[i]=0; for (var i=0; i < blds.length; i++) arField[blds[i]]++ for (var i=11; i>0; i--) { if (arField[i] > 0) { if (firstbld) firstbld = false; else b+=', '; if (arField[i] > 1) b+=arField[i] + ' x '; b+=' ' + i; } } b+='</TD></TR>'; return b; } if (t.popReport == null) { if (rpt.marchName == 'Renfort') { t.popReport = new CPopup('pbShowRein', 0, 0, 525, 340, true, function() {clearTimeout (1000);}); m+= '<DIV style="height:285px">'; } else if (rpt.marchName == 'Transport') { t.popReport = new CPopup('pbShowTrans', 0, 0, 525, 240, true, function() {clearTimeout (1000);}); m+= '<DIV style="height:185px">'; } else if (rpt.marchName == 'Eclaireur' && rslt['winner']==1 && rpt.sideId==1){ t.popReport = new CPopup('pbShowOther', 0, 0, 550, 500, true, function() {clearTimeout (1000);}); m+= '<DIV style="max-height:485px; height:485px; overflow-y:scroll">'; } else { t.popReport = new CPopup('pbShowOther', 0, 0, 550, 400, true, function() {clearTimeout (1000);}); m+= '<DIV style="max-height:385px; height:385px; overflow-y:scroll">'; } t.popReport.centerMe (mainPop.getMainDiv()); t.popReport.autoHeight (true); } m+=buildHeader(); if (rpt.marchName == 'Transport') { // Transport m+='<TABLE class=ptTab>'; // Only transports have these in rslt, so handle them here if (parseInt(rslt['gold']) > 0) m+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommas(rslt['gold'])+'</TD></TR>'; if (parseInt(rslt['resource1']) > 0) m+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommas(rslt['resource1'])+'</TD></TR>'; if (parseInt(rslt['resource2']) > 0) m+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommas(rslt['resource2'])+'</TD></TR>'; if (parseInt(rslt['resource3']) > 0) m+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommas(rslt['resource3'])+'</TD></TR>'; if (parseInt(rslt['resource4']) > 0) m+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommas(rslt['resource4'])+'</TD></TR>'; m+='</TABLE>'; } m+='<TABLE class=ptTab>'; if ((rslt['winner']==1 && rpt.sideId==0) || (rslt['winner']==0 && rpt.sideId==1)) { if (rpt.marchName == 'Eclaireur') m+='<TR><TD><FONT color="#CC0000"><B>Echec de l\'éclairage</B></font></TD></TR>'; else m+='<TR><TD><FONT color="#CC0000"><B>Défaite</B></font></TD></TR>'; } if (rslt['winner']==0 && rpt.sideId==0) m+='<TR><TD><FONT color="#66CC33"><B>Vous avez défendu avec succès !</B></font></TD></TR>'; if (rslt['winner']==1 && rpt.sideId==1) { if (rpt.marchName == 'Eclaireur') m+='<TR><TD><FONT color="#66CC33"><B>Rapport d\'éclairage</B></font></TD></TR>'; else m+='<TR><TD><FONT color="#66CC33"><B>Victoire !</B></font></TD></TR>'; } if (rslt['wall'] != undefined) { if (rslt['wall'] == 100) m+='<TR><TD>Les attaquants ont fait une brèche dans les murs. </TD></TR>'; else if (rslt['wall'] != 0) m+='<TR><TD>Les Attaquants n\'ont pas fait de brèche dans le mur. Le mur est endommagé à '+rslt['wall']+'%</TD></TR>'; } m+= '</TABLE><BR />'; if (rslt['loot'] != undefined) { m+='<TABLE class=ptTab>'; if (rslt['loot'][0] > 0) m+='<TR><TD>'+goldImg+'</TD><TD align=right>'+addCommas(rslt['loot'][0])+'</TD></TR>'; if (rslt['loot'][1] > 0) m+='<TR><TD>'+foodImg+'</TD><TD align=right>'+addCommas(rslt['loot'][1])+'</TD></TR>'; if (rslt['loot'][2] > 0) m+='<TR><TD>'+woodImg+'</TD><TD align=right>'+addCommas(rslt['loot'][2])+'</TD></TR>'; if (rslt['loot'][3] > 0) m+='<TR><TD>'+stoneImg+'</TD><TD align=right>'+addCommas(rslt['loot'][3])+'</TD></TR>'; if (rslt['loot'][4] > 0) m+='<TR><TD>'+oreImg+'</TD><TD align=right>'+addCommas(rslt['loot'][4])+'</TD></TR>'; if (rslt['loot'][5] != undefined) { for (var crest=1101; crest < 1116; crest++) { if (rslt['loot'][5][crest] == 1) m+='<TR><TD><img width=30 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/' + crest + '.png></TD><TD colspan=2>' + crestname[crest] + '</TD></TR>'; } } m+='</TABLE><BR />'; } if (rpt.marchName == 'Renfort') { m+=handleunts(); m+=handlersc(); } if (rpt.marchName == 'Eclaireur' && rslt['winner']==1) { m+='<TABLE class=ptTab width=100%><TR><TD width=50% align=left valign=top>'; m+=handleunts(); m+=handlefrt(); m+=handlersc(); m+='</TD><TD width=50% align=left valign=top>'; m+='<TABLE class=ptTab width=100%>'; if (rslt['lstlgn'] != undefined) { if (!rslt['lstlgn']) m+='<TR><TD>Dernière Connexion : -</TD></TR>'; else m+='<TR><TD>Dernière Connexion : ' + formatUnixTime(rslt['lstlgn']) + '</TD></TR>'; } m+='<TR><TD>Niveau du maréchal : '; if (rslt['knt'] != undefined) m+=rslt['knt']['cbt']; else m+='None'; m+='</TD></TR>'; if (rslt['pop'] != undefined) m+='<TR><TD>Population : ' + addCommas(rslt['pop']) + '</TD></TR>'; if (rslt['hap'] != undefined) m+='<TR><TD>Bonheur : ' + addCommas(rslt['hap']) + '</TD></TR></TABLE>'; if (rslt['blds']['b1'] != undefined || rslt['blds']['b2'] != undefined || rslt['blds']['b3'] != undefined || rslt['blds']['b4'] != undefined) { m+='<TABLE class=ptTab><TR><TH colspan=2 align=left>Champs</TH></TR>'; for (var i=1; i<5; i++) if (rslt['blds']['b'+i] != undefined) m+=handleblds(i); m+='</TABLE>'; } if (rslt['tch'] != undefined) { m+='<TABLE class=ptTab><TR><TH colspan=2 align=left>Recherche</TH></TR>'; for (var tl=1; tl < 17; tl++) if (tl != 7) m+='</TD></TR><TR><TD>'+researchLevels[tl].Name+'</TD><TD align=right>' + rslt['tch']['t'+tl] + '</TD></TR>'; m+='</TABLE>'; } m+='</TD></TR></TABLE>'; } if (rslt['fght'] != undefined){ // not Reinforce or Transport, so we have a table with 2 columns: 1 for Attackers, 1 for Defenders m+='<TABLE class=ptTab width=100%><TR><TD width=50% align=left valign=top>'; m+='<TABLE class=ptTab width=100%>'; m+='<TR><TD colspan=4><B>Attaquants</B> ('+rpt.side1Name+')'; if (rslt['winner']==1) m+='<FONT color="#CC0000"><B> Gagnant</B></FONT>'; m+='</TD></TR>'; if (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense') m+='<TR><TD colspan=4>Habileté du Chevalier au Combat : ' + rslt['s1KCombatLv'].replace('Higher','Plus élevé') + '</TD></TR>'; m+='<TR><TD colspan=4>Bonus attaque : ' + 100*rslt['s1atkBoost'] + '%</TD></TR>'; m+='<TR><TD colspan=4>Bonus défense : ' + 100*rslt['s1defBoost'] + '%</TD></TR>'; m+='<TR><TD colspan=4><a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side1XCoord +','+ rpt.side1YCoord +')</a> ' + rpt.side1CityName + '</TD></TR>'; if (rslt['fght']["s1"] != undefined) { m+='<TR><TH></TH><TH align=left>Troupes</TH><TH align=right>Battu</TH><TH align=right>Survivant</TH></TR>'; for (var i=1;i<13;i++) { if (rslt['fght']["s1"]['u'+i] != undefined) { if (rslt['fght']["s1"]['u'+i][0] > rslt['fght']["s1"]['u'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s1"]['u'+i][1])+'</FONT></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s1"]['u'+i][1])+'</td></tr>'; } } } } m+='</TABLE></TD><TD width=50% align=right valign=top>'; m+='<TABLE class=ptTab width=100%>'; m+='<TR><TD colspan=4><B>Défenseurs</B> ('+rpt.side0Name+')'; if (rslt['winner']==0) m+='<FONT color="#CC0000"><B> Gagnant</B></FONT>'; m+='</TD></TR>'; if (rpt.marchName == 'Attaque' || rpt.marchName == 'Defense') m+='<TR><TD colspan=4>Habileté du Chevalier au Combat : ' + rslt['s0KCombatLv'] + '</TD></TR>'; if (rslt['s0atkBoost'] !== undefined) m+='<TR><TD colspan=4>Bonus attaque : ' + 100*rslt['s0atkBoost'] + '%</TD></TR>'; else m+='<TR><TD colspan=4> </TD></TR>'; if (rslt['s0defBoost'] !== undefined) m+='<TR><TD colspan=4>Bonus défense : ' + rslt['s0defBoost'] + '%</TD></TR>'; else m+='<TR><TD colspan=4> </TD></TR>'; m+='<TR><TD colspan=4>Tour : ' + rslt['rnds'] + '</TD></TR>'; if (rslt['fght']["s0"] != undefined) { m+='<TR><TH></TH><TH align=left>Troupes</TH><TH align=right>Battu</TH><TH align=right>Survivant</TH></TR>'; for (var i=1;i<13;i++) { if (rslt['fght']["s0"]['u'+i] != undefined) { if (rslt['fght']["s0"]['u'+i][0] > rslt['fght']["s0"]['u'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['u'+i][1])+'</FONT></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['u'+i][1])+'</td></tr>'; } } } for (var i=53;i<=55;i++) { if (rslt['fght']["s0"]['f'+i] != undefined) { if (rslt['fght']["s0"]['f'+i][0] > rslt['fght']["s0"]['f'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</font></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</td></tr>'; } } } for (var i=60;i<=63;i++) { if (rslt['fght']["s0"]['f'+i] != undefined) { if (rslt['fght']["s0"]['f'+i][0] > rslt['fght']["s0"]['f'+i][1]) { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right><FONT color="#CC0000">'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</font></td></tr>'; } else { m+='<TR><TD>' + unitImg[i] + '</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][0])+'</td>'; m+='<TD align=right>'+addCommas(rslt['fght']["s0"]['f'+i][1])+'</td></tr>'; } } } } else m+='<TR><TD>Aucune unité défendue</TD></TR>'; m+='</TABLE></TD></TR></TABLE>'; } m+='</DIV>'; t.popReport.getMainDiv().innerHTML = m; t.popReport.getTopDiv().innerHTML = '<DIV align=center><B>Rapport '+rpt.marchName+'</B></DIV>'; t.popReport.show(true); t.popReport.autoHeight (true); }, }; /**************/ function formatUnixTime (unixTimeString,format){ var rtn = unsafeWindow.formatDateByUnixTime (unixTimeString); /*if (format=='24hour') { if (rtn.substr(14,2)=='AM') rtn = rtn.substr(0,13); else rtn = rtn.substr(8,2)+' '+rtn.substr(0,8)+(parseInt(rtn.substr(8,2))+12)+rtn.substr(10,3); } */ return rtn; } /*************** HORLOGE SUR TITRE BO **********/ var GMTclock = { //span : null, span2 : null, timer : null, init : function (){ //this.span = document.createElement ('span'); //this.span.style.fontWeight = 'bold'; //document.getElementById('kochead_time').parentNode.appendChild (this.span); this.setEnable (Options.gmtClock); }, setEnable : function (tf){ var t = GMTclock; clearInterval (t.timer); if (tf){ t.timer = setInterval (t.everySecond, 900); } else { span2 = document.getElementById('pthead_time'); if (span2) span2.innerHTML = Version; } }, everySecond : function (){ //var t = GMTclock; var now = new Date(); now.setTime(now.getTime() + (now.getTimezoneOffset()*60000)); //GMTclock.span.innerHTML = ' ('+ now.toLocaleFormat('%H:%M:%S') +' GMT)'; span2 = document.getElementById('pthead_time'); if (span2) span2.innerHTML = now.toLocaleFormat('%H:%M:%S') +' GMT'; }, } function readTrainingOptions (){ var serverID = getServerId(); s = GM_getValue ('TrainingOptions_'+serverID); if (s != null){ opts = JSON2.parse (s); for (k in opts){ /*if (matTypeof(opts[k]) == 'object') for (kk in opts[k]) TrainOptions[k][kk] = opts[k][kk]; else*/ TrainOptions[k] = opts[k]; } } } function saveTrainingOptions (){ var serverID = getServerId(); setTimeout (function (){GM_setValue ('TrainingOptions_' +serverID, JSON2.stringify(TrainOptions));}, 0); } /***** ****/ myBO.Stock= { cont : null, init : function (){ var t = myBO.autoFormation; t.cont = document.createElement('div'); }, getContent : function (){ var t = myBO.autoFormation; return t.cont; }, hide : function (){ var t = myBO.autoFormation; t.state = null; //mainPop2.div.style.height = 350 + 'px' clearTimeout (t.displayTimer); }, show : function (){ var t = myBO.autoFormation; m = "<DIV class=ptstat>INVENTAIRE STOCK</div>"; m += "<TABLE width=600 class=ptTab border=0 align=center><tr><td colspan=2>Article</td><td>Qte</td><td>Action</td></tr>"; m += "<tr><td></td>"; m+="</table>"; t.cont.innerHTML = m; }, } /***** ****/ myBO.autoFormation= { cont : null, displayTimer : null, state : null, numcity :-1, init : function (){ var t = myBO.autoFormation; t.cont = document.createElement('div'); t.state = null; setInterval(t.Start,parseInt(TrainOptions.timelauch*1000)); return t.cont; }, Start: function() { var t = myBO.autoFormation; if (!TrainOptions.Running) return; if (t.numcity<Cities.numCities-1) { t.numcity++; } else { t.numcity=0; } var c=t.numcity; var cityId=Cities.cities[c].id; // si la ville n'est pas active... on tourne :) if (!TrainOptions.listactif[cityId]) t.Start(); var populationdispo = 0; if(!TrainOptions.listlabour[t.city]) populationdispo = parseInt(Seed.citystats['city'+cityId].pop[0]) - parseInt(Seed.citystats['city'+cityId].pop[3]); else populationdispo = ((100/100)*parseInt(Seed.citystats['city'+cityId].pop[0])).toFixed(0); var availableTrainingSlots = 0; try{ var barracksTotal = getCityBuilding(cityId, 13).count; var trainingSlotsUsed = Seed.queue_unt['city'+cityId].length; if(trainingSlotsUsed!=null){ var availableTrainingSlots = barracksTotal-trainingSlotsUsed; } }finally{ } maxunite = t.unitemax(cityId, TrainOptions.list[Cities.cities[c].id]); if(availableTrainingSlots>0 && maxunite>parseInt(TrainOptions.unitemin[Cities.cities[c].id]) && TrainOptions.listactif[Cities.cities[c].id]) { var unitId = TrainOptions.list[cityId]; var num = parseInt(maxunite); if (document.getElementById('autoFError_'+cityId)) document.getElementById('autoFError_'+cityId).innerHTML="Lancement "+num+" "+unsafeWindow.unitcost['unt'+ TrainOptions.list[Cities.cities[c].id]][0]+""; var gam= TrainOptions.listboost[cityId]; var time = unsafeWindow.modal_barracks_traintime(unitId, num); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.type = unitId; params.quant = num; params.items = 0; params.gambleId = gam; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/train.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function(rslt) { if (rslt.ok) { var resourceFactors=[],resourceLost; if(gam!=null){ time=rslt.timeNeeded; } for(var i=1;i<5;i++){ if(rslt.gamble){ resourceFactors.push(rslt.gamble[i.toString()]); }else{ resourceFactors.push(1); } resourceLost=parseInt(unsafeWindow.unitcost["unt"+unitId][i])*3600*parseInt(num);resourceLost=resourceLost*resourceFactors[i-1]; unsafeWindow.seed.resources["city"+cityId]["rec"+i][0]=parseInt(unsafeWindow.seed.resources["city"+cityId]["rec"+i][0])-resourceLost; } unsafeWindow.seed.citystats["city"+cityId].gold[0]=parseInt(unsafeWindow.seed.citystats["city"+cityId].gold[0])-parseInt(unsafeWindow.unitcost["unt"+unitId][5])*parseInt(num); unsafeWindow.seed.citystats["city"+cityId].pop[0]=parseInt(unsafeWindow.seed.citystats["city"+cityId].pop[0])-parseInt(unsafeWindow.unitcost["unt"+unitId][6])*parseInt(num); unsafeWindow.seed.queue_unt["city"+cityId].push([unitId,num,rslt.initTS,parseInt(rslt.initTS)+time,0,time,null]); if(rslt.updateSeed) { unsafeWindow.update_seed(rslt.updateSeed) } if (document.getElementById('autoFError_'+cityId)) document.getElementById('autoFError_'+cityId).innerHTML+=" <b>terminée</b>"; } else { if (document.getElementById('autoFError_'+cityId)) document.getElementById('autoFError_'+cityId).innerHTML+=" <b>en erreur</b>"; } }, onFailure: function(o) { if (document.getElementById('autoFError_'+cityId)) document.getElementById('autoFError_'+cityId).innerHTML+=" <b>en erreur</b>"; } }); } else { if (document.getElementById('autoFError_'+cityId)) document.getElementById('autoFError_'+cityId).innerHTML =" <span title='Population Dispo : "+populationdispo+" - Unite Dispo MAx : "+maxunite+" - Slots disponible caserne : "+availableTrainingSlots+"'>\ <b>Conditions non remplies</b></span>"; } }, unitemax : function(currentcityid, e){ var b=new Array(); var a=new Array(); for(var d=1;d<5;d++){ b.push(parseInt(unsafeWindow.unitcost["unt"+e][d])*3600); a.push(parseInt(unsafeWindow.seed.resources["city"+currentcityid]["rec"+d][0])) } b.push(parseInt(unsafeWindow.unitcost["unt"+e][5])); a.push(parseInt(unsafeWindow.seed.citystats["city"+currentcityid].gold[0])); b.push(parseInt(unsafeWindow.unitcost["unt"+e][6])); if (!TrainOptions.listlabour[currentcityid]) { a.push(parseInt(unsafeWindow.seed.citystats["city"+currentcityid].pop[0])-parseInt(unsafeWindow.seed.citystats["city"+currentcityid].pop[3])); } else { a.push(parseInt(unsafeWindow.seed.citystats["city"+currentcityid].pop[0])); } var c=a[0]/b[0]; for(var d=1;d<b.length;d++) { if(parseInt(b[d])!=0){ c=Math.min(c,a[d]/b[d]) } } return parseInt(c)||0 }, getContent : function (){ var t = myBO.autoFormation; return t.cont; }, hide : function (){ var t = myBO.autoFormation; t.state = null; //mainPop2.div.style.height = 350 + 'px' clearTimeout (t.displayTimer); }, show : function (){ var t = myBO.autoFormation; m = "<DIV class=ptstat>FORMATIONS AUTOMATIQUE</div>"; m += "<TABLE width=600 class=ptTab border=0 align=center>\ <tr align=center valign=top>" if (TrainOptions.Running == false) { m += '<TD><INPUT id=autoFormationtoggle type=submit value="Formation AUTO = OFF"></td>'; } else { m += '<TD><INPUT id=autoFormationtoggle type=submit value="Formation AUTO = ON"></td>'; } m+="</tr></table>"; m += "<TABLE width=100% class=ptTab border=0 align=center><tr align=left><td align=left>#</td><td align=left>Actif</><td align=left>Ville</td><td align=left>Type Unité</td><td align=left>Unité Min</td><td align=left><br>Force<br>Travail</td><tD align=left>Acceleration</td><td align=center>Suivi</td></tr>"; for (var c=0; c<Cities.numCities; c++) { cityId=Cities.cities[c].id; m+="<tr><td width=5% align=right>"+(c+1)+"</td><td align=right>"; if (TrainOptions.listactif && TrainOptions.listactif[cityId] == false) { m+="<input type=checkbox id='autoFCheck_"+cityId+"'>"; }else { m+="<input checked type=checkbox id='autoFCheck_"+cityId+"'>"; } m+="</td><td width=15% align=center>"+Cities.cities[c].name+"</td><TD align=center><SELECT id='autoFType_"+cityId+"'>"; for (r=1; r<13; r++){ var faux = 0; var uc = unsafeWindow.unitcost['unt'+r]; if (matTypeof(uc[8]) == 'object'){ for (k in uc[8]){ // check building requirement var b = getCityBuilding (cityId, k.substr(1)); if (b.maxLevel < uc[8][k][1]){ faux = 1; break; } } } if (matTypeof(uc[9]) == 'object'){ for (k in uc[9]){ // check tech requirement if (parseInt(Seed.tech['tch'+k.substr(1)]) < uc[9][k][1]){ faux = 1; break; } } } if (faux==0) { if (TrainOptions.list) { if (r==TrainOptions.list[cityId]) { m+= "<option selected value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } else { m+= "<option value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } }else{ if (r==2) { m+= "<option selected value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } else { m+= "<option value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } } } } m+= "</select></td><td align=left><input type=text value='"+ parseInt(TrainOptions.unitemin[cityId]) +"' id='aFunitemin_"+cityId+"' size=4></td><td align=right>"; if (TrainOptions.listlabour && TrainOptions.listlabour[cityId] == false) { m+="<input type=checkbox id='autoFWorkers_"+cityId+"'>"; }else { m+="<input checked type=checkbox id='autoFWorkers_"+cityId+"'>"; } m+="</td><td align=right>"; m+="<select id='autoFboost_"+cityId+"'>"; m+="<option value=0>Normal</option><option value=1 "+ (TrainOptions.listboost[cityId]==1?'SELECTED ':'') +">5-15%</option><option value=2 "+ (TrainOptions.listboost[cityId]==2?'SELECTED ':'') +">10-25%</option></select>"; m+="</td><td align=right width=40%><span id='autoFError_"+cityId+"'></span></td></tr>"; } m+="</table><table width=100% class=ptTab border=0><tr><td><u>Options divers :</u><br><input id=aFtimelauch type=text size=2 value='"+parseInt(TrainOptions.timelauch)+"'> secondes pour la formation de ville en ville (enregistrer et rafraichir pour prise en compte)\ <input type=hidden size=2 id='aFpourcpop' value='100'><input type=hidden size=2 id='aFpourctot' value='100'><br>Attention 100% de la population sera utilisée (meme la force de travail si l'option est cochee) !"; m+="</td><td with=50%><input type=button value='Enregistrer' id=autoFSave></td></tr></table>"; t.cont.innerHTML = m; document.getElementById('autoFormationtoggle').addEventListener('click', function(){t.toggleautoFormationState(this)} , false); document.getElementById('autoFSave').addEventListener('click', t.saveOptionsAutoF , false); }, saveOptionsAutoF: function() { var t = myBO.autoFormation; document.getElementById('autoFSave').style.backgroundColor="#F18888"; TrainOptions.list={}; TrainOptions.listactif={}; TrainOptions.unitemin={}; TrainOptions.listlabour={}; TrainOptions.listboost={}; TrainOptions.timelauch=document.getElementById('aFtimelauch').value; TrainOptions.pourcpop=document.getElementById('aFpourcpop').value; TrainOptions.pourctot=document.getElementById('aFpourctot').value; for (var c=0; c<Cities.numCities; c++) { TrainOptions.list[Cities.cities[c].id] = document.getElementById('autoFType_'+Cities.cities[c].id).value; TrainOptions.listactif[Cities.cities[c].id] = document.getElementById('autoFCheck_'+Cities.cities[c].id).checked; TrainOptions.listlabour[Cities.cities[c].id] = document.getElementById('autoFWorkers_'+Cities.cities[c].id).checked; TrainOptions.unitemin[Cities.cities[c].id]=document.getElementById('aFunitemin_'+Cities.cities[c].id).value; TrainOptions.listboost[Cities.cities[c].id]=document.getElementById('autoFboost_'+Cities.cities[c].id).value; } saveTrainingOptions(); setTimeout(function() { document.getElementById('autoFSave').style.backgroundColor=""; }, 600); }, toggleautoFormationState : function(obj) { var t = myBO.autoFormation; // on mémorise les listes déroulante ! if (TrainOptions.Running == true) { TrainOptions.Running = false; obj.value = "FormationAUTO = OFF"; saveTrainingOptions(); } else { TrainOptions.Running = true; obj.value = "FormationAUTO = ON"; saveTrainingOptions(); } }, } /*************** ATTAQUER - RENFORCER **********/ myBO.Attaque = { cont : null, displayTimer : null, state : null, curTabBut : null, curTabName : null, BOAttackTimer: null, sourceCity : {}, destinationCity : {}, rows : [], iused : new Array(), init : function (){ var t = myBO.Attaque; t.cont = document.createElement('div'); t.state = null; clearTimeout (t.displayTimer); return t.cont; }, getContent : function (){ var t = myBO.Attaque; return t.cont; }, hide : function (){ var t = myBO.Attaque; t.state = null; clearTimeout (t.displayTimer); }, show : function (){ var t = myBO.Attaque; var rownum = 0; var ModelCity = {}; if (t.state == null) { m = "<DIV class=ptstat>ATTAQUER - RENFORCER</div>"; m +="<div id='statpourRAA'></div>"; m += "<TABLE width=600 class=ptTab border=0 align=center>\ <tr align=center valign=top><td colspan=1 width=130><b><u>Source</b></u><br><span id=RAAsrcRptspeedcity></span></td>\ <td colspan=1 width=200><b><u>Destination</b></u><br>X:<input type=text id=RAAtypetrpx size=3> Y:<input type=text id=RAAtypetrpy size=3> Distance : <span id='BOEstimationD'> </span><br><a href='javascript:void(0);' id='BOchargelistelieux'>Membres</a> : <select id='listeFavori'></select>\ <td colspan=1 width=70><input type=button id=REEaction value='Eclairer'><br><input type=button id=RAAaction value='Attaquer'><br><input type=button id=RENaction value='Renforcer'></td></tr>\ <tr align=center valign=top>\ <td colspan=3 align=left><table border=0 bordercolor=black cellspacing=0 cellpadding=0 width=100% style='text-align:center'><tr><td rowspan=13><div id=RAAstatsource></div></td><td colspan=2>Unitée</td><td>Tps Attaque</td><td>Tps Renfort</td></tr>"; for (r=1; r<13; r++){ m += '<tr><td align=right><img height=20 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg></td><td align=left><input style="border:1px solid black;height:16px;font-size:11px;" id="RAAnbunit'+r+'" type=text size=7 value="0"></td><td><span id="BOEstimationTT'+r+'"> </span></td><td><span id="BOEstimationTZ'+r+'"> </span></td></tr>'; } var itemlist=[55,57,931,932]; var BOitems=""; for(var i=0;i<itemlist.length;i++){ BOitems += "<img src='http://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/items/30/"+itemlist[i]+".jpg' /><input type=checkbox id='BOitem_"+itemlist[i]+"'><span id='BOitemSpan_"+itemlist[i]+"'>" + unsafeWindow.ksoItems[itemlist[i]].count + "</span> "; } m += "</table></td></tr>\ <tr ><td colspan=3>Chevalier (en option) : <SELECT id='RAApiKnight' type=list></select><br>"+BOitems+"</td></tr><tr><td colspan=3><div id=ptRAAStatus style='overflow-y:auto; max-height:50px; height: 50px;'></div></td></tr>\ <tr style='display:none'><td colspan=3>Programmer une attaque - VERSION BETA !!!!!<hr></tr><tr style='display:none'><td><td><input type=button id='BOActiveAttack' value='ACTIVER : OFF' ></td><td colspan=2><span id='BOCompAttack'></span></tr>\ <tr style='display:none'><td>Heure arrivée : <input type=text size=7 id='BOHorloge' value='" + Options.AttackHorloge + "'></td><td><input type=button value='Enregistrer' id='BOSaveAttack'></td><td><input type=button value='Editer' id='BOEditAttack' disabled></td></tr>\ <tr style='display:none'><td colspan=3><span id='BOAttackProg'></span></td></tr></table>"; t.cont.innerHTML = m; t.statpourRAA = document.getElementById ('statpourRAA'); document.getElementById("BOitem_55").addEventListener ('click', function() { document.getElementById("BOitem_57").checked=false; t.estimerRes(); }, false); document.getElementById("BOitem_57").addEventListener ('click', function() { document.getElementById("BOitem_55").checked=false; t.estimerRes(); }, false); t.statutRAA = document.getElementById ('ptRAAStatus'); t.destinationCityx = document.getElementById ('RAAtypetrpx'); t.destinationCityy = document.getElementById ('RAAtypetrpy'); t.destinationCityx.value = Options.Xrenfort; t.destinationCityy.value = Options.Yrenfort; if (document.getElementById ('maparea_map').style.display!="none") { t.destinationCityx.value = document.getElementById ('mapXCoor').value; t.destinationCityy.value = document.getElementById ('mapYCoor').value; } t.listeFavoris = document.getElementById ('listeFavori'); t.listeFavoris.addEventListener ('change', t.SelectFavoris, false); t.chargelistelieux = document.getElementById ('BOchargelistelieux'); t.chargelistelieux.addEventListener ('click', t.chercherFavoris, false); t.actionREN = document.getElementById ('RENaction'); t.actionREE = document.getElementById ('REEaction'); t.actionRAA = document.getElementById ('RAAaction'); t.actionREN.addEventListener ('click', function () { t.clickATTAQUEDo(2); }, false); t.actionRAA.addEventListener ('click', function () { t.clickATTAQUEDo(4); }, false); t.actionREE.addEventListener ('click', function () { t.clickATTAQUEDo(3); }, false); t.destinationCityx.addEventListener ('keyup', function () { t.estimerRes(); }, false); t.destinationCityy.addEventListener ('keyup', function () { t.estimerRes(); }, false); var dcp0 = new CdispCityPicker ('ptRAA0', document.getElementById('RAAsrcRptspeedcity'), false, t.clickRAACitySourceSelect, Cities.byID[unsafeWindow.currentcityid].idx); t.state = 1; t.estimerRes(); t.BOAttackProg = document.getElementById ('BOAttackProg'); t.BOHorloge = document.getElementById ('BOHorloge'); t.BOSaveAttack = document.getElementById ('BOSaveAttack'); t.BOEditAttack = document.getElementById ('BOEditAttack'); t.BOCompAttack = document.getElementById ('BOCompAttack'); t.BOActiveAttack = document.getElementById ('BOActiveAttack'); t.BOActiveAttack.addEventListener ('click', t.AutoattackOnOff, false); } }, clickATTAQUEDo: function(typemarche) { var t = myBO.Attaque; var totalunit=0; if (typemarche==3 && ById("RAAnbunit3").value==0) ById("RAAnbunit3").value=1; for (r=1; r<13; r++){ if (parseInt(ById("RAAnbunit"+r).value) > parseInt(ById("RAAdestunit"+r).value)) { ById("RAAnbunit"+r).style.backgroundColor="red"; return false; } totalunit=totalunit+parseInt(ById("RAAnbunit"+r).value); ById("RAAnbunit"+r).style.backgroundColor=""; } var errMsg = ""; if (isNaN (t.destinationCityx.value) ||t.destinationCityx.value<0 || t.destinationCityx.value>749) errMsg = "X doit être entre 0 et 749<BR>"; if (isNaN (t.destinationCityy.value) || t.destinationCityy.value<0 || t.destinationCityy.value>749) errMsg += "Y doit être entre 0 et 749<br>"; if (document.getElementById("RAApiKnight").value==0) { errMsg += "Impossible, vous n'avez pas choissi de chevalier !<BR>"; } if (errMsg != "") { t.statutRAA.innerHTML = '<FONT COLOR=#550000>"+ errMsg +"</font>'; return; } var x=t.destinationCityx.value; var y=t.destinationCityy.value; // On sauvegardes les coordonnes en cas de F5 t.SaveCoordsOptions(x,y); // Les objets pour l'attaque ! var e=1; var f=unsafeWindow.unixtime(); if(Seed.playerEffects.aurasExpire){ if(Seed.playerEffects.aurasExpire>f){e=1.15}} if(Seed.playerEffects.auras2Expire){if(Seed.playerEffects.auras2Expire>f){e=1.3}} var l_elem=ById("BOitem_931"); if(l_elem&&l_elem.checked&&parseInt(Seed.items["i931"])>0){ e+=0.25; } var l_elem=ById("BOitem_932"); if(l_elem&&l_elem.checked&&parseInt(Seed.items["i932"])>0){ e+=0.5; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); if (totalunit==0) { t.statutRAA.innerHTML = '<FONT COLOR=#550000>Impossible avec 0 unitée...!.</font>'; return; } var niveauPointRall=parseInt(getCityBuilding (t.sourceCity.id, 12).maxLevel); // 12=Point de ralliement var maxtroupe=parseInt(niveauPointRall*10000*e); if (niveauPointRall==11) maxtroupe=parseInt(150000*e); if (niveauPointRall==12) maxtroupe=parseInt(200000*e); if (totalunit>maxtroupe) { t.statutRAA.innerHTML = '<FONT COLOR=#550000>Impossible avec plus de '+maxtroupe+' unitées a la fois.</font>'; return; } var iused=new Array(); var itemlist=[55,57,931,932]; for(var i=0;i<itemlist.length;i++){ var l_elem=ById("BOitem_"+itemlist[i]); if(l_elem&&l_elem.checked&&parseInt(Seed.items["i"+itemlist[i]])>0){ iused.push(itemlist[i]); // } } params.items=iused.join(","); params.cid= t.sourceCity.id; params.type = typemarche; // 5 = REASSIGNER - 4 = ATTAQUE - 2 = RENFORCER params.xcoord = x; params.ycoord = y; params.kid= document.getElementById("RAApiKnight").value; params.u1 = 0; params.u2 = 0; params.u3 = 0; params.u4 = 0; params.u5 = 0; params.u6 = 0; params.u7 = 0; params.u8 = 0; params.u9 = 0; params.u10 = 0; params.u11 = 0; params.u12 = 0; if (typemarche!=3) { if (ById("RAAnbunit1").value>0) params.u1 = ById("RAAnbunit1").value; if (ById("RAAnbunit2").value>0) params.u2 = ById("RAAnbunit2").value; if (ById("RAAnbunit3").value>0) params.u3 = ById("RAAnbunit3").value; if (ById("RAAnbunit4").value>0) params.u4 = ById("RAAnbunit4").value; if (ById("RAAnbunit5").value>0) params.u5 = ById("RAAnbunit5").value; if (ById("RAAnbunit6").value>0) params.u6 = ById("RAAnbunit6").value; if (ById("RAAnbunit7").value>0) params.u7 = ById("RAAnbunit7").value; if (ById("RAAnbunit8").value>0) params.u8 = ById("RAAnbunit8").value; if (ById("RAAnbunit9").value>0) params.u9 = ById("RAAnbunit9").value; if (ById("RAAnbunit10").value>0) params.u10 = ById("RAAnbunit10").value; if (ById("RAAnbunit11").value>0) params.u11 = ById("RAAnbunit11").value; if (ById("RAAnbunit12").value>0) params.u12 = ById("RAAnbunit12").value; }else { params.u3 = ById("RAAnbunit3").value; ById("RAAnbunit3").value=0; // on remet à 0 trnaquillou ! } t.actionRAA.disabled=true; t.actionREN.disabled=true; t.actionREE.disabled=true; t.statutRAA.innerHTML = "<i><b>En cours de traitement....</b></i>"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/march.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, loading: true, onSuccess: function (transport) { var t = myBO.Attaque; var rslt = transport; if (rslt.ok) { var timediff = parseInt(rslt.eta) - parseInt(rslt.initTS); var ut = unsafeWindow.unixtime(); var unitsarr=[0,0,0,0,0,0,0,0,0,0,0,0,0]; for(i = 0; i <= unitsarr.length; i++){ if(params["u"+i]){ unitsarr[i] = params["u"+i]; } } var resources=new Array(); resources[0] = params.gold; for(i=1; i<=4; i++){ resources[i] = params["r"+i]; } var currentcityid = t.sourceCity.id; unsafeWindow.attach_addoutgoingmarch(rslt.marchId, rslt.marchUnixTime, ut + timediff, params.xcoord, params.ycoord, unitsarr, params.type, params.kid, resources, rslt.tileId, rslt.tileType, rslt.tileLevel, currentcityid, true); unsafeWindow.update_seed(rslt.updateSeed) if(rslt.updateSeed){unsafeWindow.update_seed(rslt.updateSeed)}; for(var i=0;i<iused.length;i++){ Seed.items["i"+iused[i]]=parseInt(Seed.items["i"+iused[i]])-1;unsafeWindow.ksoItems[iused[i]].subtract(); } if (typemarche==2) var typeattaque="Renfort envoyé"; if (typemarche==4) var typeattaque="Attaque envoyée"; if (typemarche==3) var typeattaque="Eclaireur envoyé"; t.statutRAA.innerHTML = "<center><font size='3px'><b>"+typeattaque+"</b></font></center>"; t.actionRAA.disabled=false; t.actionREE.disabled=false; t.actionREN.disabled=false; t.clickRAACitySourceSelect(t.sourceCity); } else { t.statutRAA.innerHTML ="<font color=red size='3px'><b>Erreur, merci de recommencer !<b></font>"; if (rslt.msg) { t.statutRAA.innerHTML +="<br><font color=black size='2px'>" + rslt.msg +"</font>"; } t.actionRAA.disabled=false; t.actionREN.disabled=false; t.actionREE.disabled=false; } }, onFailure: function () { var t = myBO.Attaque; t.statutRAA.innerHTML ="<font color=red size='3px'><b>Erreur, merci de recommencer !<b></font>"; t.actionRAA.disabled=false; t.actionREN.disabled=false; t.actionREE.disabled=false; } }); }, estimerRes: function() { var t = myBO.Attaque; // CAlcul de ETA = Estimation du temps de marches var x1 = parseInt(t.sourceCity.x); var x2 = parseInt(t.destinationCityx.value); var y1 = parseInt(t.sourceCity.y); var y2 = parseInt(t.destinationCityy.value); var dist = distance (x1, y1, x2, y2); ById("BOEstimationD").innerHTML = "<b>" + dist + "</b>"; for (r=1; r<13; r++){ var m = t.estETA(dist, r); ById("BOEstimationTT"+r).innerHTML = "<b>" + m.etaStr + "</b>"; ById("BOEstimationTZ"+r).innerHTML = "<b>" + m.friendEtaStr + "</b>"; } }, SelectFavoris:function() { var t = myBO.Attaque; if (t.listeFavoris.value!='') { var valeur=t.listeFavoris.value; var x=valeur.substr(0, valeur.lastIndexOf(',')); var y=valeur.substr(valeur.lastIndexOf(',')+1, valeur.length); //alert(x +' ' + y); t.destinationCityx.value = x; t.destinationCityy.value = y; } t.estimerRes(); }, estETA : function(dist, unit) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = myBO.Attaque; var ret={ETA:0,etaStr:'N/D',friendETA:0,friendEtaStr:'N/D'}; var cityID; if (dist <= 0) return ret; var EtaType = unit; if (EtaType==1) var baseSpeedSel="0,180"; if (EtaType==2) var baseSpeedSel="0,200"; if (EtaType==3) var baseSpeedSel="0,3000"; if (EtaType==4) var baseSpeedSel="0,300"; if (EtaType==5) var baseSpeedSel="0,275"; if (EtaType==6) var baseSpeedSel="0,250"; if (EtaType==7) var baseSpeedSel="1,1000"; if (EtaType==8) var baseSpeedSel="1,750"; if (EtaType==9) var baseSpeedSel="1,150"; if (EtaType==10) var baseSpeedSel="1,100"; if (EtaType==11) var baseSpeedSel="1,120"; if (EtaType==12) var baseSpeedSel="1,80"; var m = baseSpeedSel.split(','); var horse = 0; var baseSpeed = 0; if(m) { horse = parseInt(m[0]); baseSpeed = parseInt(m[1]); } if (baseSpeed == 0) return ret; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10.0) * (1 + hsLvl/20.0); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10.0); } //Grid Speed (tiles/second) = Speed (100ths/min) / 6000 var gSpeed = 0; var estSec; if (Speed>0) { gSpeed = Speed/6000.0;//0.48333 mm=10, hs=9 estSec = (parseFloat(dist)/gSpeed).toFixed(0); } var e=1; var l_elem=ById("BOitem_55"); if(l_elem&&l_elem.checked>0){ e=0.75; } var l_elem=ById("BOitem_57"); if(l_elem&&l_elem.checked){ e=0.5; } ret.ETA = (parseInt((estSec*e+''))+30); ret.etaStr = timestr (ret.ETA,1); cityID = t.sourceCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); ret.friendETA = parseInt((estSec*e+''))+30; ret.friendEtaStr = timestr ((ret.friendETA+''),1); } return ret; }, chercherFavoris: function() { var t = myBO.Attaque; var myA = getMyAlliance (); if (myA[0]!=0) { var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.perPage = 100; params.allianceId = myA[0]; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { // on vide la liste //t.listeFavoris.innerHTML=null; if (rslt.ok){ var z=0; var m=""; for (var i=0; i<rslt.results.length; i++){ p = rslt.results[i]; if (p.userId != 0){ //alert('ok 2 '+i); for (var c=0; c<p.cities.length; c++){ if (Seed.player.name!=p.displayName) { m += "<option value='" + p.cities[c].xCoord + ","+ p.cities[c].yCoord+"'>" + p.displayName + " - Ville " + (c+1) + " - " + p.cities[c].xCoord + "," + p.cities[c].yCoord+"</option>"; } } //fin for cities } //fin if user } //fin for resultat t.listeFavoris.innerHTML="<option value=''>Selectionner...</option>"+m; }// fin }, onFailure: function (rslt) { t.listeFavoris.innerHTML="<option>Erreur</option>"; }, }); } else { // Si pas d'alliance ! t.listeFavoris.innerHTML="<option>Pas d'alliance !</option>"; } }, SaveCoordsOptions: function(x,y) { Options.Xrenfort = x; Options.Yrenfort = y; saveOptions (); }, clickRAACitySourceSelect : function (city){ var t = myBO.Attaque; if (t.sourceCity!=city) { t.sourceCity = city; } var m=""; m="<table cellspacing=0 cellpadding=0 width=80%><tr><td colspan=2>Unitée</tr>"; var cityID = 'city'+ t.sourceCity.id; for (r=1; r<13; r++){ m += '<tr><td align=right><img title="'+unsafeWindow.unitcost['unt'+r][0]+'" height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg></td>\ <td align=left><input style="border:1px solid black;height:16px;font-size:11px;" id="RAAdestunit'+r+'" type=text size=7 readonly value="'+parseInt(Seed.units[cityID]['unt'+r])+'"> \ <input type=button value=">" id="RAApdestunit'+r+'" style="border:1px solid black;height:16px;font-size:11px;"></td></tr>'; } m += "</table>"; ById("RAAstatsource").innerHTML = m; // Recherche des chevaliers !!! var knt = new Array(); //t.getRallypoint('city' + t.sourceCity.id); for (k in Seed.knights['city' + t.sourceCity.id]){ if (Seed.knights['city' + t.sourceCity.id][k]["knightStatus"] == 1 && Seed.leaders['city' + t.sourceCity.id]["resourcefulnessKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["politicsKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["combatKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["intelligenceKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"]){ knt.push ({ Name: Seed.knights['city' + t.sourceCity.id][k]["knightName"], Combat: Seed.knights['city' + t.sourceCity.id][k]["combat"], ID: Seed.knights['city' + t.sourceCity.id][k]["knightId"], }); } } knt = knt.sort(function sort(a,b) {a = parseInt(a['combat']);b = parseInt(b['combat']);return a == b ? 0 : (a < b ? -1 : 1);}); document.getElementById('RAApiKnight').options.length=0; var o = document.createElement("option"); o.text = "--Choisis un Chevalier--" o.value = 0; document.getElementById("RAApiKnight").options.add(o); for (k in knt){ if (knt[k]["Name"] !=undefined){ var o = document.createElement("option"); o.text = (knt[k]["Name"] + ' (' + knt[k]["Combat"] +')') o.value = knt[k]["ID"]; document.getElementById("RAApiKnight").options.add(o); } } if (document.getElementById('RAApiKnight').options.length>0) { document.getElementById('RAApiKnight').selectedIndex=1; } var itemlist=[55,57,931,932]; for(var i=0;i<itemlist.length;i++){ ById('BOitemSpan_'+itemlist[i]).innerHTML = unsafeWindow.ksoItems[itemlist[i]].count; } for (r=1; r<13; r++){ ById("RAApdestunit"+r).addEventListener ('click', function() { var nomcha=this.id.replace("RAApdest","RAAdest"); var nomcha2=this.id.replace("RAApdestunit","RAAnbunit"); ById(nomcha2).value=0; // on met à 0 var e=1; var f=unsafeWindow.unixtime(); if(Seed.playerEffects.aurasExpire){if(Seed.playerEffects.aurasExpire>f){e=1.15}} if(Seed.playerEffects.auras2Expire){if(Seed.playerEffects.auras2Expire>f){e=1.3}} var l_elem=ById("BOitem_931"); if(l_elem&&l_elem.checked&&parseInt(Seed.items["i931"])>0){ e+=0.25; } var l_elem=ById("BOitem_932"); if(l_elem&&l_elem.checked&&parseInt(Seed.items["i932"])>0){ e+=0.5; } var niveauPointRall=parseInt(getCityBuilding (t.sourceCity.id, 12).maxLevel); // 12=Point de ralliement var maxtroupe=parseInt(niveauPointRall*10000*e); if (niveauPointRall==11) maxtroupe=parseInt(150000*e); if (niveauPointRall==12) maxtroupe=parseInt(200000*e); var nbunitto=0; for (r=1; r<13; r++) { nbunitto+=parseInt(ById("RAAnbunit"+r).value); } var libre = parseInt(maxtroupe - nbunitto); if (ById(nomcha).value>=libre) { ById(nomcha2).value = libre; } else { ById(nomcha2).value= ById(nomcha).value; } }, false); } if (t.sourceCity!=city) { for (r=1; r<13; r++){ ById("RAAnbunit"+r).value="0"; } } else { for (r=1; r<13; r++){ if (ById("RAAnbunit"+r).value>ById("RAAdestunit"+r).value) { ById("RAAnbunit"+r).value=0; } } } t.estimerRes(); }, } /*************** REASSIGNER **********/ my.Reassign = { cont : null, displayTimer : null, state : null, curTabBut : null, curTabName : null, sourceCity : {}, destinationCity : {}, rows : [], init : function (){ var t = my.Reassign; t.cont = document.createElement('div'); t.state = null; return t.cont; }, getContent : function (){ var t = my.Reassign; return t.cont; }, hide : function (){ var t = my.Reassign; t.state = null; clearTimeout (t.displayTimer); }, show : function (){ var t = my.Reassign; var ModelCity = {}; var rownum = 0; var rownum2 = 0; clearTimeout (t.displayTimer); function _row (name, row, noTotal){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push ('</td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += row[i]; m.push ('<TD style="background: #ffc">'); m.push (addCommas(tot)); m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); m.push (addCommas(row[i])); m.push ('</td>'); } m.push ('</tr>'); return m.join(''); } if (t.state == null) { m = "<DIV class=ptstat>Réassigner des troupes d'une ville a une autre</div>"; m +="<div id='statpourREA'></div>"; m += "<TABLE width='450px' class=ptTab border=0 align=left>\ <tr align=center valign=middle><td colspan=1 width=100><b><u>Source</b></u><br><span id=REAsrcRptspeedcity></span></td>\ <td colspan=1 width='100px'><input type=button style='font-weight:bold' id=REAaction value='Réassigner'></td>\ <td colspan=1 width='100px'><b><u>Destination</b></u><br><span id=REAdesRptspeedcity></span></td><td width=150 colspan=1><b><u>Estimation Temps</b></u><br> Distance : <span id='BOEstimationREAD'> </span></td></tr>\ <tr align=center valign=top><td width=100><div id=REAstatsource></div></td>\ <td ><table cellspacing=0 cellpadding=0 width=99%>"; for (r=1; r<13; r++){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; m += '<tr '+style+'><td align=right><img height=20 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg></td><td align=left><input style="border:1px solid black;height:16px;font-size:11px;" id="REAnbunit'+r+'" type=text size=7 value="0"></td></tr>'; } m += "</table></td><td><div id=REAstatdest></div></td>"; m += "<td colspan=2><table cellspacing=0 cellpadding=0 width=80%>"; for (r=1; r<13; r++){ if (rownum++ % 2) style = ''; else style = 'background: #e8e8e8;'; m += '<tr style="'+style+' height:16px;font-size:11px;"><td width=50% height=20 align=center><span id="BOEstimationREAZ'+r+'"> </span></td></tr>'; } m += "</tr></table>"; m += "</tr><tr><td colspan=4>Chevalier (en option) : <SELECT id='REApiKnight' type=list></tr><tr><td colspan=4><div id='ptREAStatus' style='text-align:center;overflow-y:auto; max-height:30px; height: 30px;'></div></td></tr></table>"; t.cont.innerHTML = m; t.statpourREA = document.getElementById ('statpourREA'); t.statutREA = document.getElementById ('ptREAStatus'); t.actionREA = document.getElementById ('REAaction'); t.actionREA.addEventListener ('click', t.clickReassigneDo, false); var dcp1 = new CdispCityPicker ('ptREA1', document.getElementById('REAdesRptspeedcity'), false, t.clickREACityDestinationSelect, 1); var dcp0 = new CdispCityPicker ('ptREA0', document.getElementById('REAsrcRptspeedcity'), false, t.clickREACitySourceSelect, Cities.byID[unsafeWindow.currentcityid].idx); t.state = 1; t.estimerTemps(); } /* PARTIE DES CHIFFRES DES TROUPES */ rows = []; rows[0]=[]; m = "<TABLE class=ptTabLined cellspacing=0><TR valign=top align=right><TD width=65></td><TD width=88 style='background: #ffc'><B>TOTAL</b></td>"; for(i=0; i<Cities.numCities; i++) { m += '<TD width=81><B>'+ Cities.cities[i].name.substring(0,10) +'</b></td>'; } for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } for (r=1; r<13; r++){ m += _row ('<img height=20 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg>', rows[r]); } m += "</table>"; t.statpourREA.innerHTML = m; t.displayTimer = setTimeout (t.show, 10000); }, estimerTemps: function() { var t = my.Reassign; // CAlcul de ETA = Estimation du temps de marches var x1 = parseInt(t.sourceCity.x); var x2 = parseInt(t.destinationCity.x); var y1 = parseInt(t.sourceCity.y); var y2 = parseInt(t.destinationCity.y); var dist = distance (x1, y1, x2, y2); ById("BOEstimationREAD").innerHTML = "<b>" + dist + "</b>"; for (r=1; r<13; r++){ var m = t.estETA(dist, r); ById("BOEstimationREAZ"+r).innerHTML = "<b>" + m.friendEtaStr + "</b>"; } }, estETA : function(dist, unit) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = my.Reassign; var ret={ETA:0,etaStr:'N/D',friendETA:0,friendEtaStr:'N/D'}; var cityID; if (dist <= 0) return ret; var EtaType = unit; if (EtaType==1) var baseSpeedSel="0,180"; if (EtaType==2) var baseSpeedSel="0,200"; if (EtaType==3) var baseSpeedSel="0,3000"; if (EtaType==4) var baseSpeedSel="0,300"; if (EtaType==5) var baseSpeedSel="0,275"; if (EtaType==6) var baseSpeedSel="0,250"; if (EtaType==7) var baseSpeedSel="1,1000"; if (EtaType==8) var baseSpeedSel="1,750"; if (EtaType==9) var baseSpeedSel="1,150"; if (EtaType==10) var baseSpeedSel="1,100"; if (EtaType==11) var baseSpeedSel="1,120"; if (EtaType==12) var baseSpeedSel="1,80"; var m = baseSpeedSel.split(','); var horse = 0; var baseSpeed = 0; if(m) { horse = parseInt(m[0]); baseSpeed = parseInt(m[1]); } if (baseSpeed == 0) return ret; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10.0) * (1 + hsLvl/20.0); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10.0); } //Grid Speed (tiles/second) = Speed (100ths/min) / 6000 var gSpeed = 0; var estSec; if (Speed>0) { gSpeed = Speed/6000.0;//0.48333 mm=10, hs=9 estSec = (parseFloat(dist)/gSpeed).toFixed(0); } ret.ETA = (parseInt((estSec+''))+30); ret.etaStr = timestr (ret.ETA,1); cityID = t.sourceCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); ret.friendETA = parseInt((estSec+''))+30; ret.friendEtaStr = timestr ((ret.friendETA+''),1); } return ret; }, clickReassigneDo: function() { var t = my.Reassign; t.statutREA.innerHTML = ''; // on force la ville source ! //var cityA=null; //cityA=ById('citysel_'+ (t.sourceCity.idx + 1)); //nHtml.Click(cityA); var totalunit=0; // faire les test d'unité ! for (r=1; r<13; r++){ if (parseInt(ById("REAnbunit"+r).value) > parseInt(ById("REAdestunit"+r).value)) { ById("REAnbunit"+r).style.backgroundColor="red"; return false; } totalunit=totalunit+parseInt(ById("REAnbunit"+r).value); ById("REAnbunit"+r).style.backgroundColor=""; } if (t.sourceCity.id==t.destinationCity.id) { t.statutREA.innerHTML = '<FONT COLOR=#550000>Impossible sur les memes villes !.</font>'; return; } if (totalunit==0) { t.statutREA.innerHTML = '<FONT COLOR=#550000>Impossible de reassigner avec 0 unitée... pfff !.</font>'; return; } var niveauPointRall=parseInt(getCityBuilding (t.sourceCity.id, 12).maxLevel); // 12=Point de ralliement var maxtroupe=parseInt(niveauPointRall*10000); if (niveauPointRall==11) maxtroupe=150000; if (niveauPointRall==12) maxtroupe=200000; if (totalunit>maxtroupe) { t.statutREA.innerHTML = '<FONT COLOR=#550000>Impossible de reassigner plus de '+maxtroupe+' unitées a la fois.</font>'; return; } t.actionREA.disabled=true; var x=t.destinationCity.x; var y=t.destinationCity.y; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.u1 = ById("REAnbunit1").value; params.u2 = ById("REAnbunit2").value; params.u3 = ById("REAnbunit3").value; params.u4 = ById("REAnbunit4").value; params.u5 = ById("REAnbunit5").value; params.u6 = ById("REAnbunit6").value; params.u7 = ById("REAnbunit7").value; params.u8 = ById("REAnbunit8").value; params.u9 = ById("REAnbunit9").value;; params.u10 = ById("REAnbunit10").value; params.u11 = ById("REAnbunit11").value; params.u12 = ById("REAnbunit12").value; params.cid= t.sourceCity.id; params.type = "5"; params.kid= document.getElementById("REApiKnight").value; params.xcoord = x; params.ycoord = y; t.statutREA.innerHTML ="<font size='2px'><b><i>Merci de patienter...</i></b></font>"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/march.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, loading: true, onSuccess: function (transport) { var t = my.Reassign; var rslt = transport; //eval("(" + transport.responseText + ")"); if (rslt.ok) { var timediff = parseInt(rslt.eta) - parseInt(rslt.initTS); var ut = unsafeWindow.unixtime(); var unitsarr=[0,0,0,0,0,0,0,0,0,0,0,0,0]; for(i = 0; i <= unitsarr.length; i++){ if(params["u"+i]){ unitsarr[i] = params["u"+i]; } } var resources=[0,0,0,0,0,0,0,0,0,0,0,0,0]; var currentcityid = t.sourceCity.id; unsafeWindow.attach_addoutgoingmarch(rslt.marchId, rslt.marchUnixTime, ut + timediff, params.xcoord, params.ycoord, unitsarr, params.type, params.kid, resources, rslt.tileId, rslt.tileType, rslt.tileLevel, currentcityid, true); if(rslt.updateSeed){unsafeWindow.update_seed(rslt.updateSeed)}; t.clickREACitySourceSelect(t.sourceCity); t.statutREA.innerHTML ="<font size='2px'><b>Réassignation terminée - Temps : " + timestr(timediff)+"</font>"; t.actionREA.disabled=false; } else { t.statutREA.innerHTML ="<font color=red size='2px'>Erreur, merci de recommencer </font>"; if (rslt.msg) { t.statutREA.innerHTML +="<br><font color=black size='2px'>" + rslt.msg +"</font>"; } t.actionREA.disabled=false; } }, onFailure: function () { var t = my.Reassign; t.statutREA.innerHTML ="<font color=red>Réassignation en erreur....</font>"; t.actionREA.disabled=false; } }); }, clickREACitySourceSelect : function (city){ var t = my.Reassign; var rownum=0; t.sourceCity = city; // on remplit les stat du DIV source //on efface le nbunit for (r=1; r<13; r++){ ById("REAnbunit"+r).value="0"; } t.actionREA.disabled=false; var m=""; m="<table cellspacing=0 cellpadding=0 width=80%>"; var cityID = 'city'+ t.sourceCity.id; for (r=1; r<13; r++){ if (rownum++ % 2) style = ''; else style = 'background: #e8e8e8;'; m += '<tr style="'+style+'"><td align=right><img title="'+unsafeWindow.unitcost['unt'+r][0]+'" height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg></td>\ <td align=left><input style="border:1px solid black;height:16px;font-size:11px;" id="REAdestunit'+r+'" type=text size=7 readonly value="'+parseInt(Seed.units[cityID]['unt'+r])+'"> \ <input type=button value=">" id="REApdestunit'+r+'" style="border:1px solid black;height:16px;font-size:11px;"></td></tr>'; } m += "</table>"; ById("REAstatsource").innerHTML = m; // Recherche des chevaliers !!! var knt = new Array(); //t.getRallypoint('city' + t.sourceCity.id); for (k in Seed.knights['city' + t.sourceCity.id]){ if (Seed.knights['city' + t.sourceCity.id][k]["knightStatus"] == 1 && Seed.leaders['city' + t.sourceCity.id]["resourcefulnessKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["politicsKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["combatKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"] && Seed.leaders['city' + t.sourceCity.id]["intelligenceKnightId"] != Seed.knights['city' + t.sourceCity.id][k]["knightId"]){ knt.push ({ Name: Seed.knights['city' + t.sourceCity.id][k]["knightName"], Combat: Seed.knights['city' + t.sourceCity.id][k]["combat"], ID: Seed.knights['city' + t.sourceCity.id][k]["knightId"], }); } } knt = knt.sort(function sort(a,b) {a = parseInt(a['combat']);b = parseInt(b['combat']);return a == b ? 0 : (a < b ? -1 : 1);}); document.getElementById('REApiKnight').options.length=0; var o = document.createElement("option"); o.text = "--Choisis un Chevalier--" o.value = 0; document.getElementById("REApiKnight").options.add(o); for (k in knt){ if (knt[k]["Name"] !=undefined){ var o = document.createElement("option"); o.text = (knt[k]["Name"] + ' (' + knt[k]["Combat"] +')') o.value = knt[k]["ID"]; document.getElementById("REApiKnight").options.add(o); } } for (r=1; r<13; r++){ ById("REApdestunit"+r).addEventListener ('click', function() { var nomcha=this.id.replace("REApdest","REAdest"); var nomcha2=this.id.replace("REApdestunit","REAnbunit"); ById(nomcha2).value=0; // on met à 0 var niveauPointRall=parseInt(getCityBuilding (t.sourceCity.id, 12).maxLevel); // 12=Point de ralliement var maxtroupe=parseInt(niveauPointRall*10000); if (niveauPointRall==11) maxtroupe=150000; if (niveauPointRall==12) maxtroupe=200000; var nbunitto=0; for (r=1; r<13; r++) { nbunitto+=parseInt(ById("REAnbunit"+r).value); } //console.log("Max Troupe : " + maxtroupe + " - Nbunuit : " +nbunitto); var libre = parseInt(maxtroupe - nbunitto); //console.log("libre : " + libre); // on click et on met le max de troupe dispo suivant le point de ralliement if (ById(nomcha).value>=libre) { ById(nomcha2).value = libre; } else { ById(nomcha2).value= ById(nomcha).value; } }, false); } t.estimerTemps(); }, clickREACityDestinationSelect : function (city){ var t = my.Reassign; var rownum=0; t.destinationCity = city; // on remplit les stat du DIV destination var m=""; m="<table cellspacing=0 cellpadding=0 width=80%>"; for (r=1; r<13; r++){ if (rownum++ % 2) style = ''; else style = 'background: #e8e8e8;'; cityID = 'city'+ t.destinationCity.id; m += '<tr style="'+style+'"><td align=right><img height=20 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg></td><td align=left><input style="border:1px solid black;height:16px;font-size:11px;" type=text size=7 readonly value="'+parseInt(Seed.units[cityID]['unt'+r])+'"></td></tr>'; } m += "</table>"; ById("REAstatdest").innerHTML = m; t.estimerTemps(); }, } /*************** TRANSPORT **********/ my.TranspAuto = { cont : null, displayTimer : null, state : null, curTabBut : null, curTabName : null, sourceCity : {}, destinationCity : {}, rows : [], init : function (){ var t = my.TranspAuto; t.cont = document.createElement('div'); t.state = null; clearTimeout (t.displayTimer); return t.cont; }, getContent : function (){ var t = my.TranspAuto; return t.cont; }, hide : function (){ var t = my.TranspAuto; t.state = null; clearTimeout (t.displayTimer); }, show : function (){ var t = my.TranspAuto; var rownum = 0; var ModelCity = {}; function _row (name, row, noTotal){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push ('</td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += row[i]; m.push ('<TD style="background: #ffc">'); m.push (addCommas(tot)); m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); m.push (addCommas(row[i])); m.push ('</td>'); } m.push ('</tr>'); return m.join(''); } dt = new Date (); dt.setTime (Seed.player.datejoinUnixTime * 1000); if (t.state == null) { m = "<DIV class=ptstat>Transporter des marchandises d'une ville a une autre</div>"; m +="<div id='statpourTr'></div>"; m += "<TABLE width=100% class=ptTab border=0>\ <tr align=center><td colspan=2><HR></td></tr>\ <tr align=center valign=top><td colspan=1 width=50%><b><u>Source</b></u><br><span id=srcptspeedcity></span></td>\ <td colspan=1 width=50% rowspan=2><b><u>Destination</b></u><br><span id=desptspeedcity></span><br>\ Ou des coordonnées <br>X: <input type=text size=4 id=typetrpx value=0> Y: <input type=text size=4 id=typetrpy value=0><br><a href='javascript:void(0);' id='chargelistelieux'>Membres</a> : <select id='BOlisteFavori'></select><br><br><INPUT id='ptttButTransport' type=submit value='Transporter' style='font-weight:bold'>\ </td></tr>\ <tr align=center><td colspan=1>Unité : <select id=typetrp><option selected value='1'>Unite de ravitaillement</option><option selected value='9'>Wagon</option><option value='7'>Cavalerie</option><option value='8'>Cavalerie lourde</option></select>\ <br>Quantité : <input type=text size=6 value='100' id='Choixnbwagon'><input type=button id='trswagmax' value='Max'\><br><i>(la quantité de ressource est le maximun des unités choisies)</i>\ <br><b>Type de ressource :</b><br><input type=radio id='ChoixRess0' name='ChoixRess' value='gold'> Or\ <input type=radio id='ChoixRess1' name='ChoixRess' value='rec1'> Nourriture\ <input type=radio id='ChoixRess2' name='ChoixRess' value='rec2'> Bois\ <input type=radio id='ChoixRess3' name='ChoixRess' value='rec3'> Pierre\ <input type=radio id='ChoixRess4' name='ChoixRess' value='rec4'> Minerais\ </td></tr>\ <tr><td colspan=2>Estimation des ressources transportées : <span id=BOEstimationR></td></tr>\ </table>\ <TABLE align=center width=100% class=ptTab><TR><TD><div id=ptTranportStatus style='text-align:center;overflow-y:auto; max-height:78px; height: 78px;'></div></td></tr></table>"; t.cont.innerHTML = m; t.destinationCityx = document.getElementById ('typetrpx'); t.destinationCityy = document.getElementById ('typetrpy'); t.destinationCityx.addEventListener ('change', t.estimerRes, false); t.destinationCityy.addEventListener ('change', t.estimerRes, false); document.getElementById ('ChoixRess0').addEventListener ('click', t.estimerRes, false); document.getElementById ('ChoixRess1').addEventListener ('click', t.estimerRes, false); document.getElementById ('ChoixRess2').addEventListener ('click', t.estimerRes, false); document.getElementById ('ChoixRess3').addEventListener ('click', t.estimerRes, false); document.getElementById ('ChoixRess4').addEventListener ('click', t.estimerRes, false); t.listeFavoris = document.getElementById ('BOlisteFavori'); t.estimationRes = document.getElementById ('BOEstimationR'); t.chargelistelieux = document.getElementById ('chargelistelieux'); t.chargelistelieux.addEventListener ('click', t.chercherFavoris, false); t.listeFavoris.addEventListener ('change', t.SelectFavoris, false); var dcp1 = new CdispCityPicker ('ptspeed1', document.getElementById('desptspeedcity'), false, t.clickCityDestinationSelect, 1); t.TTbutTransport = document.getElementById ('ptttButTransport'); t.TTbutTransport.addEventListener ('click', t.clickTransportDo, false); t.divTranportStatus = document.getElementById ('ptTranportStatus'); t.statpourTr = document.getElementById ('statpourTr'); t.typetrp = document.getElementById ('typetrp'); t.typetrp.addEventListener ('click', t.estimerRes, false); t.trswagmax = document.getElementById ('trswagmax'); t.trswagmax.addEventListener ('click', t.clickUniteMax, false); t.Choixnbwagon = document.getElementById ('Choixnbwagon'); t.Choixnbwagon.addEventListener ('keyup', t.verifierWagons, false); var dcp0 = new CdispCityPicker ('ptspeed0', document.getElementById('srcptspeedcity'), false, t.clickCitySourceSelect, Cities.byID[unsafeWindow.currentcityid].idx); t.state = 1; if (document.getElementById ('maparea_map').style.display!="none") { t.destinationCityx.value = document.getElementById ('mapXCoor').value; t.destinationCityy.value = document.getElementById ('mapYCoor').value; } } rows=[]; rows[0]=[]; m = "<TABLE class=ptTabLined cellspacing=0><TR valign=top align=right><TD width=65></td><TD width=88 style='background: #ffc'><B>TOTAL</b></td>"; for(i=0; i<Cities.numCities; i++) { m += '<TD width=81><B>'+ Cities.cities[i].name.substring(0,10) +'</b></td>'; } for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[0][i] = parseInt(Seed.citystats[cityID].gold[0]); } for (r=1; r<5; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.resources[cityID]['rec'+r][0] / 3600); } } m += _row ('<img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_30.png>', rows[0]); m += _row ('<img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png>', rows[1]); m += _row ('<img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png>', rows[2]); m += _row ('<img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png>', rows[3]); m += _row ('<img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png>', rows[4]); m += '<TR><TD><font size=1><BR></td></tr>'; row = []; var totalbouffe = 0; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var usage = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; } m += _row ('Prod', row, false, 0); for(i=0; i<Cities.numCities; i++) { if (row[i] >= 0) row[i] = '----'; else { var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-row[i]) * 3600; if (timeLeft > 86313600) row[i] = '----'; else { if (Options.enableFoodWarn && timeLeft<(Options.foodWarnHours*3600)) row[i] = '<SPAN class=whiteOnRed>'+ timestrShort(timeLeft) +'</span>'; else row[i] = timestrShort(timeLeft); } } } m += _row ('Aut.', row, true, 0); m += '<TR><TD><font size=1><BR></td></tr>'; for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } m += _row ('<img height=20 title="'+unsafeWindow.unitcost['unt1'][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_1_30.jpg>', rows[1]); m += _row ('<img height=20 title="'+unsafeWindow.unitcost['unt7'][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_7_30.jpg>', rows[7]); m += _row ('<img height=20 title="'+unsafeWindow.unitcost['unt8'][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_8_30.jpg>', rows[8]); m += _row ('<img height=20 title="'+unsafeWindow.unitcost['unt9'][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_9_30.jpg>', rows[9]); m += "</table>"; t.statpourTr.innerHTML = m; t.displayTimer = setTimeout (t.show, 5000); }, SelectFavoris:function() { var t = my.TranspAuto; if (t.listeFavoris.value!='') { var valeur=t.listeFavoris.value; var x=valeur.substr(0, valeur.lastIndexOf(',')); var y=valeur.substr(valeur.lastIndexOf(',')+1, valeur.length); //alert(x +' ' + y); t.destinationCityx.value = x; t.destinationCityy.value = y; } t.estimerRes(); }, chercherFavoris: function() { var t = my.TranspAuto; var myA = getMyAlliance (); if (myA[0]!=0) { var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.perPage = 100; params.allianceId = myA[0]; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { // on vide la liste //t.listeFavoris.innerHTML=null; if (rslt.ok){ var z=0; var m=""; for (var i=0; i<rslt.results.length; i++){ p = rslt.results[i]; if (p.userId != 0){ //alert('ok 2 '+i); for (var c=0; c<p.cities.length; c++){ if (Seed.player.name!=p.displayName) { m += "<option value='" + p.cities[c].xCoord + ","+ p.cities[c].yCoord+"'>" + p.displayName + " - Ville " + (c+1) + " - " + p.cities[c].xCoord + "," + p.cities[c].yCoord+"</option>"; } } //fin for cities } //fin if user } //fin for resultat t.listeFavoris.innerHTML="<option value=''>Selectionner...</option>"+m; }// fin }, onFailure: function (rslt) { t.listeFavoris.innerHTML="<option>Erreur</option>"; }, }); } else { // Si pas d'alliance ! t.listeFavoris.innerHTML="<option>Pas d'alliance !</option>"; } }, /******* transport ****/ verifierWagons: function() { var t = my.TranspAuto; var maxw=parseInt(rows[t.typetrp.value][t.sourceCity.idx]); var saisw=parseInt(t.Choixnbwagon.value); if (saisw > maxw) { t.Choixnbwagon.value=maxw; t.divTranportStatus.innerHTML = '<FONT COLOR=#550000>La quantité ne peut excéder '+maxw+' !.</font>'; } t.estimerRes(); }, estimerRes: function() { var t = my.TranspAuto; var esti = parseInt(unsafeWindow.unitstats['unt'+t.typetrp.value][5] * t.Choixnbwagon.value * (1 + (0.10 * Seed.tech.tch10))); // CAlcul de ETA = Estimation du temps de marches var x1 = parseInt(t.sourceCity.x); var x2 = parseInt(t.destinationCityx.value); var y1 = parseInt(t.sourceCity.y); var y2 = parseInt(t.destinationCityy.value); var dist = distance (x1, y1, x2, y2); var m = t.estETA(dist); t.estimationRes.innerHTML = "<b>" + addCommas(esti) + "</b>"; t.estimationRes.innerHTML += "<br>Estimation temps de marche : <b>" + m.friendEtaStr + "</b>" ; // test sur les ressources choisit ! var cityID = 'city'+ t.sourceCity.id; var ic=0; var resact=0; var ic_ty="gold"; var ic_text="d'or"; if (document.getElementById("ChoixRess1").checked) { ic_ty="rec1";ic=1;ic_text="de nourriture"; } if (document.getElementById("ChoixRess2").checked) { ic_ty="rec2";ic=2;ic_text="de bois"; } if (document.getElementById("ChoixRess3").checked) { ic_ty="rec3";ic=3;ic_text="de pierre"; } if (document.getElementById("ChoixRess4").checked) { ic_ty="rec4";ic=4;ic_text="de minerais"; } if (Seed.resources[cityID][ic_ty][0]) resact = parseInt(Seed.resources[cityID][ic_ty][0] / 3600); if (resact < esti) { var nbparunit = parseInt(unsafeWindow.unitstats['unt'+t.typetrp.value][5] * 1 * (1 + (0.10 * Seed.tech.tch10))); var uniteness = Math.round(resact / nbparunit) - 1; //t.estimationRes.innerHTML += "<br><font color=red><b>Ressource disponible insuffisante :</b></font> Il vous faut <a id='TRPclickunit' href='#'>" + uniteness + "</a> "+unsafeWindow.unitcost['unt'+ t.typetrp.value][0]; //t.TTbutTransport.disabled = true; //document.getElementById ('TRPclickunit').addEventListener ('click', // function() { t.Choixnbwagon.value = uniteness; t.TTbutTransport.disabled = false; t.estimerRes(); //}, false); // } else { // t.TTbutTransport.disabled = false; } }, estETA : function(dist) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = my.TranspAuto; var ret={ETA:0,etaStr:'NA',friendETA:0,friendEtaStr:'NA'}; var cityID; if (dist <= 0) return ret; var EtaType = document.getElementById('typetrp').value; if (EtaType==1) var baseSpeedSel="0,180"; if (EtaType==9) var baseSpeedSel="1,150"; if (EtaType==7) var baseSpeedSel="1,1000"; if (EtaType==8) var baseSpeedSel="1,750"; //var baseSpeedSel = EtaType.options[EtaType.selectedIndex].value; var m = baseSpeedSel.split(','); var horse = 0; var baseSpeed = 0; if(m) { horse = parseInt(m[0]); baseSpeed = parseInt(m[1]); } if (baseSpeed == 0) return ret; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10.0) * (1 + hsLvl/20.0); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10.0); } //Grid Speed (tiles/second) = Speed (100ths/min) / 6000 var gSpeed = 0; var estSec; if (Speed>0) { gSpeed = Speed/6000.0;//0.48333 mm=10, hs=9 estSec = (parseFloat(dist)/gSpeed).toFixed(0); } ret.ETA = (parseInt((estSec+''))+30); ret.etaStr = timestr (ret.ETA,1); cityID = t.sourceCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); ret.friendETA = parseInt((estSec+''))+30; ret.friendEtaStr = timestr ((ret.friendETA+''),1); } return ret; }, clickUniteMax: function() { var t = my.TranspAuto; var maxw=parseInt(rows[t.typetrp.value][t.sourceCity.idx]); var niveauPointRall=parseInt(getCityBuilding (t.sourceCity.id, 12).maxLevel); // 12=Point de ralliement var maxtroupe=parseInt(niveauPointRall*10000); if (niveauPointRall==11) maxtroupe=150000; if (niveauPointRall==12) maxtroupe=200000; if (maxw>maxtroupe) maxw=maxtroupe; t.Choixnbwagon.value=maxw; t.estimerRes(); }, clickTransportDo: function() { // fonction pour faire le transport var t = my.TranspAuto; var SourceId = t.sourceCity.id; var DestinationId = t.destinationCity.id; if (!document.getElementById("ChoixRess0").checked && !document.getElementById("ChoixRess1").checked && !document.getElementById("ChoixRess2").checked && !document.getElementById("ChoixRess3").checked && !document.getElementById("ChoixRess4").checked) { t.divTranportStatus.innerHTML = '<FONT COLOR=#550000>Merci de cocher un type de ressource !</font>'; return; } if (t.sourceCity.x==t.destinationCityx.value && t.sourceCity.y==t.destinationCityy.value) { t.divTranportStatus.innerHTML = '<FONT COLOR=#550000>Impossible sur les mê mes villes !.</font>'; return; } if (parseInt(t.Choixnbwagon.value)=="0") { t.divTranportStatus.innerHTML = '<FONT COLOR=#550000>Impossible de transporter avec 0 unitée... pfff !.</font>'; return; } var x=t.destinationCityx.value; var y=t.destinationCityy.value; if (x == 0 || y == 0) { t.divTranportStatus.innerHTML = '<FONT COLOR=#550000>Impossible de transporter sur la destination 0,0 !.</font>'; return; } t.TTbutTransport.disabled=true; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.kid = 0; params.cid= t.sourceCity.id; params.type = "1"; params.xcoord = x; params.ycoord = y; params.r1 = 0; params.r2 = 0; params.r3 = 0; params.r4 = 0; params.gold = 0; params.u9 = 0; var esti = parseInt(unsafeWindow.unitstats['unt'+t.typetrp.value][5] * t.Choixnbwagon.value * (1 + (0.10 * Seed.tech.tch10))); if (document.getElementById("ChoixRess0").checked) { params.gold = esti; } if (document.getElementById("ChoixRess1").checked) { params.r1 = esti; } if (document.getElementById("ChoixRess2").checked) { params.r2 = esti; } if (document.getElementById("ChoixRess3").checked) { params.r3 = esti; } if (document.getElementById("ChoixRess4").checked) { params.r4 = esti; } if (t.typetrp.value==1) params.u1 = t.Choixnbwagon.value; if (t.typetrp.value==9) params.u9 = t.Choixnbwagon.value; if (t.typetrp.value==7) params.u7 = t.Choixnbwagon.value; if (t.typetrp.value==8) params.u8 = t.Choixnbwagon.value; t.divTranportStatus.innerHTML = "<i><b>En cours de traitement....</b></i>"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/march.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, loading: true, onSuccess: function (transport) { var t = my.TranspAuto; var rslt = transport; if (rslt.ok) { var timediff = parseInt(rslt.eta) - parseInt(rslt.initTS); var ut = unsafeWindow.unixtime(); var unitsarr=[0,0,0,0,0,0,0,0,0,0,0,0,0]; for(i = 0; i <= unitsarr.length; i++){ if(params["u"+i]){ unitsarr[i] = params["u"+i]; } } var resources=new Array(); resources[0] = params.gold; for(i=1; i<=4; i++){ resources[i] = params["r"+i]; } var currentcityid = t.sourceCity.id; unsafeWindow.attach_addoutgoingmarch(rslt.marchId, rslt.marchUnixTime, ut + timediff, params.xcoord, params.ycoord, unitsarr, params.type, params.kid, resources, rslt.tileId, rslt.tileType, rslt.tileLevel, currentcityid, true); unsafeWindow.update_seed(rslt.updateSeed) if(rslt.updateSeed){unsafeWindow.update_seed(rslt.updateSeed)}; //t.clickCitySourceSelect(t.sourceCity); t.divTranportStatus.innerHTML = "<font size='3px'><b>Transport effectué.</b>"; t.TTbutTransport.disabled=false; //t.Choixnbwagon.value = 0; } else { t.divTranportStatus.innerHTML ="<font color=red size='3px'><b>Erreur, merci de recommencer !<b></font>"; if (rslt.msg) { t.divTranportStatus.innerHTML +="<br><font color=black size='2px'>" + rslt.msg +"</font>"; } t.TTbutTransport.disabled=false; } }, onFailure: function () { var t = my.TranspAuto; t.divTranportStatus.innerHTML ="<font color=red size='3px'><b>Erreur, merci de recommencer !<b></font>"; t.TTbutTransport.disabled=false; } }); }, clickCitySourceSelect : function (city){ var t = my.TranspAuto; t.sourceCity = city; t.TTbutTransport.disabled=false; // en cas de changement de ville, faire le test et mettre quantite max var maxw=parseInt(rows[t.typetrp.value][t.sourceCity.idx]); var saisw=parseInt(t.Choixnbwagon.value); if (saisw > maxw) t.Choixnbwagon.value=maxw; t.estimerRes(); }, clickCityDestinationSelect : function (city){ var t = my.TranspAuto; t.destinationCity = city; t.destinationCityx.value=t.destinationCity.x; t.destinationCityy.value=t.destinationCity.y; t.TTbutTransport.disabled=false; t.estimerRes(); }, } /*************** WILDS TAB *********************/ var wildNames = { 0: 'Marais', 10: 'Prairie', 11: 'Lac', 20: 'Bois', 30: 'Collines', 40: 'Montagne', 50: 'Plaine', }; var mercNames = { 0: 'Aucun', 1: 'Novices', 2: 'Intermediaire', 3: 'Vétérans', }; my.Wilds = { tabOrder : 35, cont : null, state : null, upGoldTimer : null, wildList : [], buildList : {}, init : function (){ var t = my.Wilds; t.cont = document.createElement('div'); unsafeWindow.ptButMaxTraps = t.e_butMaxTraps; unsafeWindow.ptInpWildTraps = t.e_inpTraps; unsafeWindow.ptButWildSet = t.e_butWildSet; unsafeWindow.ptButWildShow = t.show; return t.cont; }, getContent : function (){ var t = my.Wilds; return t.cont; }, hide : function (){ var t = my.Wilds; clearTimeout (t.upGoldTimer); }, show : function (){ var t = my.Wilds; clearTimeout (t.upGoldTimer); if (t.state == null){ t.cont.innerHTML = '<DIV id=wildContent style="maxheight:665px; height:665px; overflow-y:auto">'; t.state = 1; } m = '<CENTER>'+ strButton20('RESET', 'id=ptwref') +'</center><TABLE cellspacing=0 cellpadding=0 class=ptTabPad align=center>'; for (var c=0; c<Cities.numCities; c++){ var city = Cities.cities[c]; t.wildList[c] = []; var totWilds = 0; var datw = Seed.wilderness['city'+ city.id]; if (datw!=null && matTypeof(datw)=='object') for (k in datw) ++totWilds; var nivcastle = parseInt(Seed.buildings['city'+ city.id].pos0[1]); var castle = nivcastle; if (nivcastle==11) castle=12; if (nivcastle==12) castle=14; if (totWilds < castle) { var totWildsstring = '<SPAN style="font-color:red"><B>'+ totWilds +'/'+ castle +'</b></span>'; }else{ var totWildsstring = totWilds +'/'+ castle; } m += '<TR><TD colspan=21><DIV class=ptstat>'+ city.name +' ('+ city.x +','+ city.y +') - '+totWildsstring+'</div></td></tr>'; var row = 0; var sortem = []; var cWilds = Seed.wilderness['city'+city.id]; if (matTypeof(cWilds) != 'array') { m += '<TR style="background-color:white; font-weight:bold;" align=right><TD align=left>Type TS</td><TD></td><TD align=left>Coords</td><td>Dist</td><TD>Pièges</td><TD align=left>Mercenaires</td>\ <TD width=15></td><TD colspan=3 class=entry>'+ htmlTitleLine(' CONFIGURATION DES DEFENSES ') +'</td></tr>'; for (var k in Seed.wilderness['city'+city.id]) sortem.push (Seed.wilderness['city'+city.id][k]); sortem.sort (function (a,b){ var x; if ((x = b.tileLevel-a.tileLevel)!=0) return x; return a.tileType-b.tileType; }); for (i=0; i<sortem.length; i++){ var wild = sortem[i]; var wildDef = Seed.wildDef['t'+wild.tileId]; if (wildDef==undefined || !wildDef) wildDef = {fort60Count:0, mercLevel:0}; var maxTraps = parseInt(wild.tileLevel)*100; var maxBuild = maxTraps - parseInt(wildDef.fort60Count); var distancedelaville = distance (city.x, city.y, wild.xCoord, wild.yCoord); t.wildList[c][i] = [wild.tileId, maxBuild]; m += '<TR align=right'+ (row++%2?'':' class=ptOddrow') +'><TD align=left><a onclick="citysel_click(document.getElementById(\'citysel_'+ (c+1)+'\'));setTimeout (function (){modal_wilderness_abandon('+wild.tileId+','+ wild.tileLevel +','+wild.tileType+','+ wild.xCoord +','+ wild.yCoord +');setTimeout(function(){ ptButWildShow(this); },4000);},500);return false;"><img src="http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png" border=0 title="Abandonner la TS"></a> '+ wildNames[wild.tileType] +'</td>\ <TD>'+ wild.tileLevel +'</td><TD align=center>\ <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ wild.xCoord +','+ wild.yCoord +')</a></td><td><b>'+distancedelaville+'</td>\ <TD align=right><B>'+ wildDef.fort60Count +'</b></td><TD align=center><B>'+ mercNames[wildDef.mercLevel] +'</b></td>\ <TD></td><TD align=left class=ptentry><B>Ajout Pièges :</b> <INPUT onchange="ptInpWildTraps(this)" id=ptwt_'+ c +'_'+ i + (maxBuild==0?' DISABLED ':'')+' style="margin:0px; padding:0px" type=text size=3 maxlength=4></td>' if (wildDef.fort60Count < maxTraps) m += '<TD class=ptentry style="padding:0px">'+ strButton14('Max', 'id=ptwx_'+ c +'_'+ i +' onclick="ptButMaxTraps(this)"') +'</td>'; else m += '<TD class=ptentry></td>'; m += '<TD class=ptentry> <B>Mercs:</b> ' + htmlSelector(mercNames, wildDef.mercLevel, 'id=ptwm_'+ c +'_'+ i) +' </td></tr>'; } m += '<TR><TD colspan=7></td><TD class=ptentry align=center colspan=3><TABLE><TR><TD width=40% align=left>Coût Or : <SPAN id=ptwgc_'+ c +'>0</span></td>\ <TD width=10%>'+ strButton20("METTRE A JOUR", 'onclick="ptButWildSet('+ c +')"') +'<TD width=40% align=right>Or dispo : <SPAN id=ptwgt_'+ c +'>0</span></td></td></tr></table></td></tr>'; } else { m+= '<TR><TD colspan=10> </td></tr>'; } } document.getElementById('wildContent').innerHTML = m + '</table></div>'; document.getElementById('ptwref').addEventListener ('click', t.show, false); t.updateGold (); }, e_butWildSet : function (c){ var t = my.Wilds; var totTraps = 0; var cid = Cities.cities[c].id; t.buildList = {cityId:cid, list:[]}; for (var w=0; w<t.wildList[c].length; w++){ var wild = Seed.wilderness['city'+cid]['t'+t.wildList[c][w][0]]; var wildDef = Seed.wildDef['t'+t.wildList[c][w][0]]; // TODO: Seed.wildDef is null if just aquired if (wildDef==undefined || !wildDef) wildDef = {fort60Count:0, mercLevel:0}; var numTraps = parseInt(document.getElementById('ptwt_'+ c +'_'+ w).value, 10); if (isNaN(numTraps)) numTraps = 0; totTraps += numTraps; if (numTraps > 0) t.buildList.list.push (['T', wild.tileId, numTraps]); var mercId =document.getElementById('ptwm_'+ c +'_'+ w).value; if (wildDef.mercLevel != mercId) t.buildList.list.push (['M', wild.tileId, mercId, wildDef.mercLevel]); } var totCost = totTraps * 200; if (totCost > parseInt(Seed.citystats['city'+cid].gold[0])){ document.getElementById('ptwgc_'+ c).innerHTML = '<SPAN class=boldRed>'+ addCommasInt(totCost) +'</span>'; return; } if (t.buildList.list.length == 0) return; t.setCurtain (true); var popDiv = t.setPopup (true); popDiv.innerHTML = '<TABLE class=ptTab width=100% height=100%><TR><TD>\ <DIV class=ptstat>Configuration des défences des terres sauvages (TS)</div>\ <DIV id=ptWildBuildDiv class=ptDiv style="padding:10px; height:225px; max-height:225px; overflow-y:auto"></div>\ </td></tr><TR><TD align=center>'+ strButton20('ANNULER', 'id=ptWildCancel') +'</td></tr></table>'; document.getElementById('ptWildCancel').addEventListener('click', t.e_buildCancel, false); t.processQue(null); }, e_buildCancel : function (){ var t = my.Wilds; t.setCurtain(false); t.setPopup(false); t.show(); }, processQue : function (errMsg){ var t = my.Wilds; var what = t.buildList.list.shift(); var div = document.getElementById('ptWildBuildDiv'); if (what==null || errMsg){ if (errMsg) div.innerHTML += '<BR><SPAN style="white-space:normal;" class=boldRed>ERREUR : '+ errMsg +'</span>'; else div.innerHTML += 'Effectuée.<BR>'; document.getElementById('ptWildCancel').firstChild.innerHTML = 'FERMER'; return; } if (div.innerHTML != '') div.innerHTML += 'Effectuée.<BR>'; var wild = Seed.wilderness['city'+ t.buildList.cityId]['t'+what[1]]; if (what[0] == 'T'){ div.innerHTML += 'Construction de '+ what[2] +' pièges sur '+ Cities.byID[t.buildList.cityId].name +'\' sur Terres au '+ wild.xCoord +','+ wild.yCoord +' ... '; t.postBuyTraps (t.buildList.cityId, what[1], what[2], t.processQue); } else { div.innerHTML += 'Configure Mercenaires -'+ mercNames[what[2]] +'- sur '+ Cities.byID[t.buildList.cityId].name +'\' sur Terres au '+ wild.xCoord +','+ wild.yCoord +' ... '; t.postHireMercs (t.buildList.cityId, what[1], what[2], what[3], t.processQue); } }, setPopup : function (onoff){ var t = my.Wilds; if (onoff){ var div = document.createElement('div'); div.id = 'ptWildPop'; div.style.backgroundColor = '#fff'; div.style.zindex = mainPop.getZindex()+2; div.style.opacity = '1'; div.style.border = '3px outset red'; div.style.width = '550px'; div.style.height = '300px'; div.style.display = 'block'; div.style.position = 'absolute'; div.style.top = '100px'; div.style.left = '100px'; t.cont.appendChild (div); return div; } else { t.cont.removeChild (document.getElementById('ptWildPop')); } }, setCurtain : function (onoff){ var t = my.Wilds; if (onoff){ var off = getAbsoluteOffsets (t.cont); var curtain = document.createElement('div'); curtain.id = 'ptWildCurtain'; curtain.style.zindex = mainPop.getZindex()+1; curtain.style.backgroundColor = "#000000"; curtain.style.opacity = '0.5'; curtain.style.width = t.cont.clientWidth +'px'; curtain.style.height = t.cont.clientHeight +'px'; curtain.style.display = 'block'; curtain.style.position = 'absolute'; curtain.style.top = off.top + 'px'; curtain.style.left = off.left + 'px'; t.cont.appendChild (curtain); } else { t.cont.removeChild (document.getElementById('ptWildCurtain')); } }, e_butMaxTraps : function (e){ var t = my.Wilds; var c = e.id.substr(5,1); var w = e.id.substr(7); var inp = document.getElementById('ptwt_'+ c +'_'+ w); inp.value = t.wildList[c][w][1]; t.e_inpTraps (inp); }, e_inpTraps : function (e){ var t = my.Wilds; var c = e.id.substr(5,1); var w = e.id.substr (7); var tot = 0; for (var i=0; i<t.wildList[c].length; i++) { var val = parseInt(document.getElementById('ptwt_'+ c +'_'+ i).value, 10); if (isNaN(val)) val = 0; tot += val; } document.getElementById('ptwgc_'+ c).innerHTML = addCommasInt(tot * 200); if (isNaN(e.value) || e.value<0 || e.value>t.wildList[c][w][1]){ e.value = ''; e.style.backgroundColor = '#ffaaaa'; } else e.style.backgroundColor = null; }, updateGold : function (){ var t = my.Wilds; for (var c=0; c<Cities.numCities; c++){ var e = document.getElementById('ptwgt_'+ c +''); if (e) e.innerHTML = addCommasInt(Seed.citystats['city'+Cities.cities[c].id].gold[0]); } t.upGoldTimer = setTimeout (t.updateGold, 5000); }, postBuyTraps : function (cid, tid, quant, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.tid = tid; params.quant = quant; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/buyWildTraps.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ if (!Seed.wildDef["t"+ tid]) Seed.wildDef["t"+ tid] = {tileId:tid, fort60Count:0, mercLevel:0}; Seed.wildDef["t"+ tid].fort60Count = parseInt(Seed.wildDef["t"+ tid].fort60Count) + parseInt(quant); } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, postHireMercs : function (cid, tid, newLevel, oldLevel, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.tid = tid; params.lv = newLevel; params.olv = oldLevel; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/hireWildMerc.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ if (!Seed.wildDef["t"+ tid]) Seed.wildDef["t"+ tid] = {tileId:tid, fort60Count:0, mercLevel:0}; Seed.wildDef["t"+ tid].mercLevel = newLevel; } if (notify) notify (rslt.errorMsg); }, onFailure: function () { if (notify) notify ('AJAX ERROR'); }, }); }, } /*************** KNIGHTS TAB *********************/ my.Knights = { cont : null, state : null, displayTimer : null, action : 0, init : function (){ var t = my.Knights; t.cont = document.createElement('div'); unsafeWindow.ptAssignSkill = t.clickedAssignPoints; unsafeWindow.ptAssignTunes = t.clickedAssignTune; return t.cont; }, getContent : function (){ var t = my.Knights; return t.cont; }, hide : function (){ var t = my.Knights; clearTimeout (t.displayTimer); }, show : function (){ var t = my.Knights; clearTimeout (t.displayTimer); if (t.state == null){ t.cont.innerHTML = '<STYLE>table.ptTabPad tr.ptwpad {background-color:#ffffff; padding-left:5px}</style>\ <DIV id=ptknightdiv style="max-height:660px; height:660px; overflow-y:auto">'; t.state = 1; } function _dispKnight (roleId, knight, numcid){ var rid = roleId; if (roleId==null) rid = 1; var sty=''; if (row++ % 2) sty = 'class=ptOddrow '; m = '<TR '+ sty +'valign=top align=right><TD><font size=1><B>'+ (roleId==null ? '':knightRoles[rid][0]) +'</b></td><TD align=left>'; if (knight == null) { m += '--------</td><TD colspan=5></td><TD class=ptentry colspan=5></td><TD colspan=2></td></tr>'; } else { var level = parseInt(Math.sqrt(parseInt(knight.experience) / 75)) + 1; var unpoints = level - parseInt(knight.skillPointsApplied); var salary = (parseInt(knight.skillPointsApplied) + 1) * 20; totSalary += salary; var ass = ''; if (knight.knightStatus == 10){ ass = '<TD class=ptentry align=left colspan=4>Marchant</td>'; } else { if (unpoints > 0){ unpoints = '<SPAN class="boldRed">'+ unpoints +'</span>'; for (var i=0; i<4; i++){ var sty = 'padding-left:1px;'; if (i == rid) { // bold it sty += 'font-weight:bold;color:#116654'; if (t.action==1) { t.clickedAssignPoints(null, cid,knight.knightId,i); } if (t.action==2) { t.clickedAssignPoints(null, cid,knight.knightId,1); } } ass += '<TD class=ptentry align=left style="'+ sty +'" ><A style="'+ sty +'" onclick="ptAssignSkill(this,' + cid +','+ knight.knightId +','+ i +')">['+ knightRoles[i][2] +'] </a></td>'; } } else ass = '<TD class=ptentry colspan=4></td>'; } var skills = []; for (var i=0; i<4; i++){ if (i == rid) skills[i] = '<B>'+ knight[knightRoles[i][1]] +'</b>'; else skills[i] = knight[knightRoles[i][1]]; } var item211="0"; var item221="0"; var item231="0"; var item241="0"; if (Seed.items.i211) item211='<a onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ boost_modal(1,'+ knight.knightId +');return false;}, 500);">'+Seed.items.i211+'</a>'; if (Seed.items.i221) item221='<a onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ boost_modal(2,'+ knight.knightId +');return false;}, 500);">'+Seed.items.i221+'</a>'; if (Seed.items.i231) item231='<a onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ boost_modal(3,'+ knight.knightId +');return false;}, 500);">'+Seed.items.i231+'</a>'; if (Seed.items.i241) item241='<a onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ boost_modal(4,'+ knight.knightId +');return false;}, 500);">'+Seed.items.i241+'</a>'; m += '<a title="Assigner un role" onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ assign_role_modal('+ knight.knightId +');return false;}, 500);">' + knight.knightName.substring(0,20) + '</a></td><TD><a title="Augmenter EXP" onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ xpBoost_modal('+ knight.knightId +');return false; }, 500);" href="javascript:void(0)">'+ level +'</a></td><TD>'+ skills[0] +' ('+item211+')</td><TD>'+ skills[1] +' ('+item221+')</td><TD>'+ skills[2] +' ('+item231+')</td><TD>' + skills[3] +' ('+item241+')</td><TD class=ptentry>'+ unpoints +'</td>'+ ass +'<td><a onclick="citysel_click(document.getElementById(\'citysel_'+ (numcid+1)+'\'));setTimeout (function (){ loyalBoost_modal('+ knight.knightId +');return false;}, 500);" colspan=2>'+knight.loyalty+'</a><img onclick="ptAssignTunes(' + cid +','+ knight.knightId +');" src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_16.png" title="Booster la loyaute a 5% avec l\'or"></td><TD>'+ addCommas(salary) +'</td></tr>'; } return m; } var totSalary = 0; var m = '<TABLE cellspacing=0 align=center class=ptTabPad><TBODY><TR><td colspan=15><DIV class=ptstat>Gestion des chevaliers - <input style="height:20px;font-size:9px;" type=button value="Attribution par defaut" id="BOchebut"><input style="height:20px;font-size:9px;" type=button value="Attribution en combat" id="BOchebut1"></div></td></tr>'; for (var c=0; c<Cities.numCities; c++) { var cid = Cities.cities[c].id; m += '<tr><TD colspan=15><DIV class=ptstat>'+ Cities.cities[c].name +'</div></td></tr>\ <TR class=ptwpad style="font-weight:bold" align=right><TD width=70>Role</td><TD width=140 align=center>Nom</td><TD width=22>Niv</td><TD width=25>Pol</td><TD width=25>Com</td>\ <TD width=25>Int</td><TD width=25>Res</td><TD width=75 align=center colspan=5>--- non attribué ---</td><td witdh=25 colspan=1>Loy</td><TD width=40 align=right> Salaire </td></tr>'; totSalary = 0; var did = {}; var row = 0; for (var i=0; i<knightRoles.length; i++){ var leader = Seed.leaders['city'+cid][knightRoles[i][1]+'KnightId']; if (leader == 0) m += _dispKnight (i, null, c); else { m += _dispKnight (i, Seed.knights['city'+cid]['knt'+leader], c); did['knt'+leader] = true; } } var list = []; for (k in Seed.knights['city'+cid]){ if (!did[k]) list.push (Seed.knights['city'+cid][k]); } list.sort (function (a,b){return parseInt(b.combat)-parseInt(a.combat)}); for (i=0; i<list.length; i++) m += _dispKnight (null, list[i], c); m += '<TR align=right><TD colspan=13><B>Salaire Total :</b></td><TD>'+ addCommas(totSalary) +'</td></tr>'; } document.getElementById('ptknightdiv').innerHTML = m +'</tbody></table></div>'; t.action = 0; but = document.getElementById('BOchebut'); but.addEventListener ('click', function (){ t.action=1; t.show(); }, false); but = document.getElementById('BOchebut1'); but.addEventListener ('click', function (){ t.action=2; t.show(); }, false); t.displayTimer = setTimeout (t.show, 10000); }, clickedAssignTune: function(cid, kid) { var t = my.Knights; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.kid = kid; params.rid=0; params.standalone=0; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/rewardKnight.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { var knight = Seed.knights["city" + cid]["knt" + kid]; knight.loyalty = parseInt(knight.loyalty) + 5; } }, onFailure: function () { }, }); }, clickedAssignPoints : function (e, cid, kid, rid){ var t = my.Knights; clearTimeout (t.displayTimer); var knight = Seed.knights['city'+cid]['knt'+kid]; if (knight.knightStatus == 10 && e!=null){ var row = e.parentNode.parentNode; row.childNodes[7].innerHTML = 'Marchant'; return; } sk = []; var unassigned = parseInt(Math.sqrt(parseInt(knight.experience)/75)) + 1 - parseInt(knight.skillPointsApplied); for (var i=0; i<4; i++){ sk[i] = parseInt(knight[knightRoles[i][1]]); if (i == rid) sk[i] += unassigned; } if (e!=null) { var row = e.parentNode.parentNode; for (i=row.cells.length-1; i>=1; i--) row.deleteCell (i); var newCell=row.insertCell(-1); newCell.colSpan = 12; newCell.align= 'left'; newCell.style.padding='1px 5px 1px 10px'; var div = document.createElement ('div'); div.style.backgroundColor = '#ffffff'; div.style.textAlign = 'center'; div.style.border = '1px solid'; div.style.width = '98%'; div.style.whiteSpace = 'normal'; newCell.appendChild (div); div.innerHTML = 'Assignation de '+ unassigned +' compétence(s) '+ knightRoles[rid][1] +' ... '; } t.postSkillPoints (cid, kid, sk[0], sk[1], sk[2], sk[3], function (r){t.postDone(r, div)}); }, postDone : function (rslt, div){ var t = my.Knights; clearTimeout (t.displayTimer); if (rslt.ok){ div.innerHTML += '<B>Effectuée.</b>'; t.displayTimer = setTimeout (t.show, 5000); } else { div.innerHTML += '<BR><SPAN class=boldRed>ERREUR : '+ rslt.errorMsg +'</span>'; t.displayTimer = setTimeout (t.show, 10000); } }, postSkillPoints : function (cid, kid, pol, com, int, res, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cid; params.kid = kid; params.p = pol; params.c = com; params.i = int; params.r = res; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/skillupKnight.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { var knight = Seed.knights["city" + cid]["knt" + kid]; var up = pol + com + int + res - knight.politics - knight.combat - knight.intelligence - knight.resourcefulness; knight.politics = pol; knight.combat = com; knight.intelligence = int; knight.resourcefulness = res; knight.skillPointsApplied = (parseInt(knight.skillPointsApplied) + up).toString(); } if (notify) notify (rslt); }, onFailure: function () { if (notify) notify (rslt); }, }); }, }; /**************/ var messageNav = { mmFunc : null, mmsFunc : null, init : function (){ t = messageNav; t.mmFunc = new CalterUwFunc ('modal_messages', [[/}\s*$/, 'setTimeout(messageNav_hook,0); }']]); t.mmsFunc = new CalterUwFunc ('modal_messages_send', [[/{\s*var params/i, '{\nif (modal_messages_send_hook()) return;\nvar params']]); unsafeWindow.messageNav_hook = messageNav.hook; unsafeWindow.modal_messages_send_hook = messageNav.msgSendHook; t.mmFunc.setEnable (true); t.mmsFunc.setEnable (true); }, setEnable : function (tf){ }, isAvailable : function (){ t = messageNav; return t.mmFunc.isAvailable(); }, hook : function (){ if (!Options.enhanceMsging) return; var div = document.getElementById('modal_msg_view_actions'); //var but = makeButton20('Transferer'); //div.appendChild (but); //but.addEventListener ('click', messageNav.eventForward, false); div = document.getElementById('modal_msg_write_to').parentNode; div.innerHTML = '<TABLE><TR><TD class=xtab><b>A :</b> <INPUT type=text id=modal_msg_write_to></td>\ <TD class=xtab></td></tr>\ <tr><td></td><td></td></tr></table>\ <table><tr><TD colspan=2><SPAN id=pt2fwdbut></span></td></tr></table>'; document.getElementById('pt2fwdbut').innerHTML="Cc : <INPUT type=text id=message_cc>"; // Ajout liste déroulante avec nom des Vice-chanceliers }, eventForward : function (){ document.getElementById('modal_msg_write_subj').value = "TR: " + document.getElementById('modal_msg_view_subj').innerHTML.toString().stripTags(); document.getElementById('modal_msg_write_to').value = ''; var from = document.getElementById('modal_msg_view_from').children[0].innerHTML; var body = document.getElementById('modal_msg_view_body').innerHTML.replace(/\n/g, '').replace(/<br>/gi, '\n').stripTags().replace (/back$/i, ''); document.getElementById('modal_msg_write_txt').value = '[Message original de '+ from +']\n'+ body; unsafeWindow.modal_messages_compose(); }, msgSendHook : function (){ if (!Options.enhanceMsging) return; var to = document.getElementById("modal_msg_write_to").value.trim(); var chaine = document.getElementById("message_cc").value; var tableau = chaine.split(";") if (tableau.length==0) tableau[0]=chaine; for (var i = 0; i < tableau.length; i++) { var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.emailTo = tableau[i] ; params.subject = "CC: "+document.getElementById("modal_msg_write_subj").value; params.message = document.getElementById("modal_msg_write_txt").value; params.requestType = 'COMPOSED_MAIL'; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getEmail.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { //var rslt = eval("(" + message.responseText + ")"); if (rslt.ok) { document.getElementById('message_cc').value = ""; //unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.msgsent + ' a ' + tableau[i]); } }, }); } if (to.toLowerCase() != '<officiers>' || getMyAlliance()[0]==0) { return false; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.toIds = getMyAlliance()[0]; params.subject = document.getElementById("modal_msg_write_subj").value +''; params.message = document.getElementById("modal_msg_write_txt").value; params.type = 'alliance'; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/sendMessage.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { //var rslt = eval("(" + message.responseText + ")"); if (rslt.ok) { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.msgsent); document.getElementById('modal_msg_write_to').value = ""; document.getElementById('modal_msg_write_subj').value = ""; document.getElementById('modal_msg_write_txt').value = "" } else { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.enterexistingname) } }, onFailure: function () { unsafeWindow.Modal.showAlert(unsafeWindow.g_js_strings.modal_messages_send.oopscompose) }, }); return true; }, } var AttackDialog = { init : function (){ var t = AttackDialog; t.modal_attackFunc = new CalterUwFunc ('modal_attack', [[/}\s*$/, 'attackDialog_hook(); }']]); unsafeWindow.attackDialog_hook = t.modalAttackHook; t.modal_attackFunc.setEnable (true); }, setEnable : function (){ }, isKnightSelectAvailable : function (){ var t = AttackDialog; return t.modal_attackFunc.isAvailable(); }, isAttackCityPickerAvailable : function (){ var t = AttackDialog; return t.modal_attackFunc.isAvailable(); }, modalAttackHook : function (){ var t = AttackDialog; if (Options.fixKnightSelect || Options.attackCityPicker){ for (var i=1; i<6; i++) document.getElementById('modal_attack_tab_'+ i).addEventListener('click', t.e_changeMarchType, false); } if (Options.attackCityPicker){ setTimeout (t.initCityPicker, 0); } }, initCityPicker : function (){ var t = AttackDialog; var div = document.getElementById('modal_attack_target_numflag'); // as of KofC version 96; var mySpan; if (div) { div.parentNode.innerHTML += ' <SPAN id=modal_attack_citybuts></span>'; } else { var span = document.getElementById('modal_attack_target_coords'); // KofC version 116+; span.parentNode.parentNode.firstChild.innerHTML += ' <SPAN id=modal_attack_citybuts></span>'; } new CdispCityPicker ('ptatp', document.getElementById('modal_attack_citybuts'), false, t.e_CityButton); var cityIdx = Cities.byID[unsafeWindow.currentcityid].idx; thisCityBut = document.getElementById('ptatp_'+ cityIdx); thisCityBut.style.opacity = '0.5'; thisCityBut.disabled = true; if (document.getElementById('modal_attack_tab_4').className=='selected' || document.getElementById('modal_attack_tab_3').className=='selected') // don't do for attack or scout document.getElementById('modal_attack_citybuts').style.display = 'none'; }, e_CityButton : function (city){ document.getElementById('modal_attack_target_coords_x').value = city.x; document.getElementById('modal_attack_target_coords_y').value = city.y; unsafeWindow.modal_attack_update_time(); }, e_changeMarchType : function (evt){ var t = AttackDialog; var marchType = parseInt(evt.target.id.substr(17)); if (Options.attackCityPicker){ if (marchType==3 || marchType==4) document.getElementById('modal_attack_citybuts').style.display = 'none'; else document.getElementById('modal_attack_citybuts').style.display = 'inline'; } if (Options.fixKnightSelect){ var knightVal = 0; var selector = document.getElementById('modal_attack_knight'); if (selector.length>1 && (marchType==4 || marchType==2)) // if 'attack' or 'reinforce' knightVal = 1; selector.selectedIndex = knightVal; } }, } var AllianceReports = { checkPeriod : 300, allianceNames : [], saveArfunc : unsafeWindow.allianceReports, init : function (){ t = AllianceReports; t.enable (Options.enhanceARpts); t.marvFunc = new CalterUwFunc ('modal_alliance_report_view', [['getReportDisplay', 'getReportDisplay_hook2']]); unsafeWindow.getReportDisplay_hook2 = t.getReportDisplayHook; t.marvFunc.setEnable (true); }, getReportDisplayHook : function (a, b){ var x = ''; try { x = unsafeWindow.getReportDisplay(a,b); } catch (e){ x = 'Error formatting report: '+ e; } return x; }, enable : function (tf){ t = AllianceReports; if (tf) unsafeWindow.allianceReports = t.myAllianceReports; else unsafeWindow.allianceReports = t.saveArfunc; }, myAllianceReports : function (pageNum){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); if (pageNum) params.pageNo = pageNum; params.group = "a"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/listReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { displayReports (rslt.arReports, rslt.arPlayerNames, rslt.arAllianceNames, rslt.arCityNames, rslt.totalPages); }, onFailure: function (rslt) { }, }, false); function displayReports (ar, playerNames, allianceNames, cityNames, totalPages){ var msg = new Array(); var myAllianceId = getMyAlliance()[0]; msg.push ("<STYLE>.msgviewtable tbody .myCol div {margin-left:5px; overflow:hidden; white-space:nowrap; color:#000}\ .msgviewtable tbody .myHostile div {font-weight:600; color:#600}\ .msgviewtable tbody .myGray div {color:#666}\ .msgviewtable tbody .myRein div {color:#050}\ .msgviewtable tbody .myWarn div {font-weight:600; color:#442200}\ </style>"); msg.push("<div class='modal_msg_reports'>"); var rptkeys = unsafeWindow.Object.keys(ar); //alert(rptkeys.length); if (matTypeof(ar) != 'array') { if (Options.allowAlterAR) msg.push("<div id='modal_alliance_reports_tablediv' class='modal_msg_list'><table width=675 cellpadding='0' cellspacing='0' class='msgviewtable reportviewtable alliancetable'>"); else msg.push("<div id='modal_alliance_reports_tabledivNKA' class='modal_msg_list'><table width=675 cellpadding='0' cellspacing='0' class='msgviewtable reportviewtable alliancetable'>"); msg.push("<thead><tr><td width=105>Date</td><td width=40>Type</td><td width=150>Attaquant</td><td>Cible</td><td>Voir</td><td colspan=2>Dist. ville</tr></thead><tbody>"); for (var i = 0; i < rptkeys.length; i++) { var rpt = ar[rptkeys[i]]; var colClass = '"myCol"'; rpt.marchType = parseInt(rpt.marchType); rpt.side0AllianceId = parseInt(rpt.side0AllianceId); var targetDiplomacy = getDiplomacy (rpt.side0AllianceId); if (rpt.marchType == 2){ colClass = '"myCol myRein"'; } else if (rpt.side1AllianceId != myAllianceId){ colClass = '"myCol myHostile"'; } else { if (parseInt(rpt.side0TileType) < 50){ // if wild if (parseInt(rpt.side0PlayerId) == 0) colClass = '"myCol myGray"'; else colClass = '"myCol myWarn"'; } else if (parseInt(rpt.side0PlayerId) == 0) { // barb colClass = '"myCol myGray"'; } else { if (targetDiplomacy == 'friendly') colClass = '"myCol myWarn"'; } } msg.push ('<tr valign=top'); if (i%2 == 0) msg.push(" class=stripe"); msg.push("><TD class="+ colClass +"><div>"); msg.push(unsafeWindow.formatDateByUnixTime(rpt.reportUnixTime)); msg.push ('<BR>Rpt #'); msg.push (rpt.reportId); msg.push("</div></td><TD class="+ colClass +"><div>"); //rpt.marchType = parseInt(rpt.marchType); if (rpt.marchType == 1) msg.push (unsafeWindow.g_js_strings.commonstr.transport); else if (rpt.marchType == 3) msg.push (unsafeWindow.g_js_strings.commonstr.scout); else if (rpt.marchType == 2) msg.push ('Renf'); else msg.push (unsafeWindow.g_js_strings.commonstr.attack); // attacker ... msg.push ("</div></td><TD class="+ colClass +"><div>"); if (parseInt(rpt.side1PlayerId) != 0) msg.push('<a onclick=getInfoForAnUser("'+parseInt(rpt.side1PlayerId)+'");>'+escape(playerNames["p" + rpt.side1PlayerId])+"</a>"); else msg.push ('?Unknown?'); msg.push (' <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side1XCoord +','+ rpt.side1YCoord +')</a><bR>'); if (rpt.side1AllianceId != myAllianceId){ msg.push (allianceNames['a'+rpt.side1AllianceId]); msg.push (' ('); msg.push (getDiplomacy(rpt.side1AllianceId)); msg.push (')'); } else { msg.push ('<BR>'); } msg.push ('</div></td>'); // cible ... msg.push ("<TD class="+ colClass +"><DIV>"); var type = parseInt(rpt.side0TileType); if (type < 50){ // pour la TS msg.push(unsafeWindow.g_mapObject.types[type].toString().capitalize()); msg.push(" Lvl " + rpt.side0TileLevel) if (parseInt(rpt.side0PlayerId) != 0) { // IF OWNED, show owner ... msg.push (' ['); msg.push ('<a @onclick=getInfoForAnUser("'+parseInt(rpt.side0PlayerId)+'");>' + escape(playerNames["p" + rpt.side0PlayerId])+'</a>'); msg.push ('] '); } } else { if (parseInt(rpt.side0PlayerId) == 0) { // barb msg.push(unsafeWindow.g_js_strings.commonstr.barbariancamp); msg.push(" Lvl " + rpt.side0TileLevel) } else { // city msg.push ('<a onclick=getInfoForAnUser("'+ rpt.side0PlayerId+'");>' + escape(playerNames["p" + rpt.side0PlayerId])+'</a>'); msg.push (' - '); msg.push (cityNames['c'+ rpt.side0CityId]); } } msg.push (' <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ rpt.side0XCoord +','+ rpt.side0YCoord +')</a>'); if (rpt.side0AllianceId!=0 && rpt.side0AllianceId!=myAllianceId){ msg.push ('<BR>'); msg.push (allianceNames['a'+rpt.side0AllianceId]); msg.push (' ('); msg.push (targetDiplomacy); msg.push (')'); } // 'view report' link ... if (Options.allowAlterAR) msg.push("</div></td><TD class="+ colClass +"><div><a onclick=' modal_alliance_report_view(\""); // ONCLICK ??? else msg.push("</div></td><TD class="+ colClass +"><div><a onclick=' $(\"modal_alliance_reports_tabledivNKA\").id=\"modal_alliance_reports_tablediv\"; modal_alliance_report_view(\""); // ONCLICK ??? msg.push(rpt.reportId); msg.push('",'); if (parseInt(rpt.side1AllianceId) == parseInt(Seed.allianceDiplomacies.allianceId)) msg.push(1); else msg.push(0); msg.push(","); msg.push(rpt.side0TileType); msg.push(","); msg.push(rpt.side0TileLevel); msg.push(","); msg.push(rpt.side0PlayerId); msg.push(',"'); if (parseInt(rpt.side0PlayerId) != 0) msg.push(escape(playerNames["p" + rpt.side0PlayerId])); else msg.push(unsafeWindow.g_js_strings.commonstr.enemy); msg.push('","'); if (parseInt(rpt.side0PlayerId) != 0) msg.push(escape(playerNames["g" + rpt.side0PlayerId])); else msg.push(0) msg.push('","'); if (parseInt(rpt.side1PlayerId) > 0) msg.push(escape(playerNames["p" + rpt.side1PlayerId])); msg.push('","'); if (parseInt(rpt.side1PlayerId) != 0) msg.push(escape(playerNames["g" + rpt.side1PlayerId])); msg.push('",'); msg.push(rpt.marchType); msg.push(","); msg.push(rpt.side0XCoord); msg.push(","); msg.push(rpt.side0YCoord); msg.push(","); msg.push(rpt.reportUnixTime); msg.push(","); if (parseInt(rpt.reportStatus) == 2) msg.push(1); else msg.push(0); if (rpt.side1XCoord) { msg.push(","); msg.push(rpt.side1XCoord); msg.push(","); msg.push(rpt.side1YCoord) } else { msg.push(",,"); } msg.push(");return false;'><img border=0 src='http://cdn1.iconfinder.com/data/icons/woothemesiconset/16/search_button.png'></a></div></td></tr>"); } msg.push("</tbody></table></div>"); } msg.push("</div><div id='modal_report_list_pagination'></div>"); document.getElementById('allianceContent').innerHTML = msg.join(""); if (pageNum) { unsafeWindow.ctrlPagination("modal_report_list_pagination", totalPages, "allianceReports", pageNum) } else { unsafeWindow.ctrlPagination("modal_report_list_pagination", totalPages, "allianceReports") } } }, } // end AllianceReports singleton /************************ Food Alerts *************************/ var FoodAlerts = { init : function (){ var f = FoodAlerts; f.e_eachMinute(); }, minuteTimer : null, e_eachMinute : function (){ var f = FoodAlerts; var now = unixTime(); row = []; if (Options.enableFoodWarnTchat) { for(i=0; i < Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var foodleft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0])/3600; var usage = rp[1] - parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-usage) * 3600; var msg = ''; if (timeLeft<0){ } else if (timeLeft<(Options.foodWarnHours*3600)) { msg += 'Ma ville ' + Cities.cities[i].name.substring(0,10) + ' ' + Cities.cities[i].x +','+ Cities.cities[i].y + ' '; msg += 'a besoin de pommes. Restant : '+addCommasWhole(foodleft).replace(',',' ').replace(',',' ').replace(',',' ').replace(',',' ')+' ('+timestrShort(timeLeft)+') Production : '+addCommas(usage).replace(',',' ').replace(',',' ').replace(',',' ').replace(',',' ')+'/h'; sendChat ("/a " + msg); } } f.minuteTimer = setTimeout (f.e_eachMinute, 1800000); } }, } /************************ Tower Alerts ************************/ var TowerAlerts = { viewImpendingFunc : null, generateIncomingFunc : null, fixTargetEnabled : false, towerMarches : {}, // track all marches that have been posted to alliance chat init : function (){ var t = TowerAlerts; var s = GM_getValue ('towerMarches_'+getServerId()); if (s != null) t.towerMarches = JSON2.parse (s); t.viewImpendingFunc = new CalterUwFunc ('attack_viewimpending_view', [[/Modal.showModal\((.*)\)/im, 'Modal.showModal\($1\); ptViewImpending_hook(a);']]); unsafeWindow.ptViewImpending_hook = t.viewImpending_hook; t.viewImpendingFunc.setEnable (true); t.generateIncomingFunc = new CalterUwFunc ('attack_generateincoming', [[/.*} else {\s*e = true;\s*}/im, '} else { e = ptGenerateIncoming_hook(); }']]); unsafeWindow.ptGenerateIncoming_hook = t.generateIncoming_hook; }, // fix 'target', add button viewImpending_hook : function (atkinc){ var t = TowerAlerts; var div = document.getElementById('modal_attackimpending_view'); var isFalse = false; if (t.fixTargetEnabled){ var city = Cities.byID[atkinc.toCityId]; var target = ''; if (!city || (atkinc.marchType!=3 && atkinc.marchType!=4)){ target = '<B>FALSE REPORT!</b>'; isFalse = true; } else if (city.tileId == atkinc.toTileId){ target = city.name + ' ('+ city.x + ','+ city.y +')'; } else { wilds = Seed.wilderness['city'+atkinc.toCityId]; m = ''; for (k in wilds){ if (wilds[k].tileId == atkinc.toTileId){ m = 'at '+ wilds[k].xCoord + ','+ wilds[k].yCoord; break; } } target = city.name + ', <B>TS '+ m +'</b>'; } div.childNodes[0].innerHTML = '<B>Cible : </b>'+ target; } }, // fix false reports generateIncoming_hook : function (){ return false; }, enableFixFalseReports : function (tf){ var t = TowerAlerts; t.generateIncomingFunc.setEnable (tf); }, enableFixTarget : function (tf){ var t = TowerAlerts; t.fixTargetEnabled = tf; }, isFixTargetAvailable : function (){ var t = TowerAlerts; return t.viewImpendingFunc.isAvailable(); }, isFixFalseReportsAvailable : function (){ var t = TowerAlerts; return t.generateIncomingFunc.isAvailable(); }, postToChatOptions : {aChat:false}, secondTimer : null, e_buttonPostToChat : function (march){ var t = TowerAlerts; t.postToChat (march, true); unsafeWindow.Modal.hideModal(); }, setPostToChatOptions : function (obj){ var t = TowerAlerts; t.postToChatOptions = obj; clearTimeout(t.secondTimer); if (obj.aChat) t.e_eachSecond(); //DD two lines deleted }, addTowerMarch : function (m){ var t = TowerAlerts; var now = unixTime(); for (k in t.towerMarches){ if (t.towerMarches[k].arrival < now) delete t.towerMarches[k]; } t.towerMarches['m'+m.mid] = {added:now, arrival:parseIntNan(m.arrivalTime) }; GM_setValue ('towerMarches_'+getServerId(), JSON2.stringify(t.towerMarches) ); }, getTowerMarch : function (mid){ // ID only (no 'm') var t = TowerAlerts; return t.towerMarches['m'+mid]; }, e_eachSecond : function (){ // check for incoming marches var t = TowerAlerts; var now = unixTime(); if (matTypeof(Seed.queue_atkinc) != 'array'){ for (var k in Seed.queue_atkinc){ var m = Seed.queue_atkinc[k]; if ((m.marchType==3 || m.marchType==4) && parseIntNan(m.arrivalTime)>now && t.getTowerMarch(m.mid)==null){ t.addTowerMarch (m); t.postToChat (m, false); // Montrer l'ecran d'attaque !! if (Options.alertConfig.showAttack) { mainPop.show (true); setTimeout(function() { nHtml.Click(ById('aaMarches')); },100); } } } } t.secondTimer = setTimeout (t.e_eachSecond, 2000); }, postToChat: function(m, force){ var t = TowerAlerts; //var postOptions = Options.alertConfig; var postOptions = t.postToChatOptions; var troopsnames = ['Rav', 'Mil', 'Ecl', 'Piq', 'Pal', 'Arc', 'Cav', 'Lou', 'Wagon', 'Bali', 'Bel', 'Cat']; var tot = []; for (i = 0; i < 13; i++) tot[i] = 0; if (DEBUG_TRACE) { logit("checkTower(): INCOMING at " + unixTime() + ": \n" + inspect(m, 8, 1)); } if (m.marchType == null) {// bogus march (returning scouts) if (DEBUG_TRACE) { logit("checkTower(): m.marchType == null"); } return; } if (m.marchType == 3) { if (!postOptions.scouting && !force) return; atkType = 'ECLAIREUR'; if (DEBUG_TRACE) { logit("checkTower(): scout"); } } else { if (m.marchType == 4) { atkType = 'ATTAQUE'; if (DEBUG_TRACE) { logit("checkTower(): attack"); } } else { if (DEBUG_TRACE) { logit("checkTower(): unkown march typ"); } return; } } if (DEBUG_TRACE) { logit("checkTower(): after typ"); } var target, atkType, who; var city = Cities.byID[m.toCityId]; if (city.tileId == m.toTileId) { target = 'VILLE ' + city.name + ' ' + city.x + ',' + city.y+' '; if (postOptions.marechal) { var now = unixTime(); marshallCombatScore = 0; var s = Seed.knights['city'+m.toCityId]; if (s) { s = s["knt" + Seed.leaders['city'+m.toCityId].combatKnightId]; if (s){ marshallCombatScore = s.combat; if (s.combatBoostExpireUnixtime > now) marshallCombatScore *= 1.25; } } target += ' (Marechal ' + parseInt(marshallCombatScore) + ') '; } } else { if (!postOptions.wilds && !force) return; target = 'TS'; for (k in Seed.wilderness['city' + m.toCityId]) { if (Seed.wilderness['city' + m.toCityId][k].tileId == m.toTileId) { target += ' ' + Seed.wilderness['city' + m.toCityId][k].xCoord + ',' + Seed.wilderness['city' + m.toCityId][k].yCoord+' '; break; } } } var attackermight = ''; var allianceId = ''; if (Seed.players['u' + m.pid]) { who = Seed.players['u' + m.pid].n; attackermight = parseInt(Seed.players['u' + m.pid].m); allianceId = Seed.players['u' + m.pid].a; } else { if (m.players && m.players['u' + m.pid]) { who = m.players['u' + m.pid].n; attackermight = parseInt(m.players['u' + m.pid].m); allianceId = m.players['u' + m.pid].a; } else { who = 'Inconnu'; } } if (m.fromXCoord) who += ' sur ' + m.fromXCoord + ',' + m.fromYCoord; var diplomacy = getDiplomacy(allianceId); var arrivingDatetime = new Date(); arrivingDatetime.setTime(m.arrivalTime * 1000); if (DEBUG_TRACE) { logit("checkTower(): Before Messagecreate"); } /** ** message ** */ var msg = ''; var subject = ''; msg = postOptions.aPrefix + ' '; msg += 'Mon QG: ' + postOptions.hq + '. '; if (postOptions.empennage) { msg += 'Empennage ' + parseInt(Seed.tech['tch13']) + '. '; } msg += 'Type : ' + atkType + '. '; msg += 'Cible : ' + target + '. '; msg += 'Attaquant : ' + who + ' (' + addCommas(attackermight).replace(',',' ').replace(',',' ') + ', ' + diplomacy + ').'; msg +=' ** ARRIVEE ** : '; var totTroops = 0; for (k in m.unts) { var uid = parseInt(k.substr(1)); msg += m.unts[k].replace(',',' ').replace(',',' ') + ' ' + unsafeWindow.unitcost['unt' + uid][0] + ', '; totTroops += m.unts[k]; } if ((totTroops < postOptions.minTroops) && !force) return; msg = msg.slice(0, -2); msg += ' (arrive dans ' + unsafeWindow.timestr(parseInt(m.arrivalTime - unixTime())) + ' -> ' + arrivingDatetime +').' ; var msgpart1=''; if (parseInt(Seed.citystats["city" + m.toCityId].gate) == 0 && Options.alertConfig.defence==true) { msg += '>> Sanctuaire <<'; } if (parseInt(Seed.citystats["city" + m.toCityId].gate) == 1 && Options.alertConfig.defence==true) { msg += ' >> En defense << '; } /** ** Embassy** **/ if (city.tileId == m.toTileId) { var emb = getCityBuilding(m.toCityId, 8); if (emb.count > 0) { var availSlots = emb.maxLevel; for (k in Seed.queue_atkinc) { if (Seed.queue_atkinc[k].marchType == 2 && Cities.byID[Seed.queue_atkinc[k].fromCityId] == null) { --availSlots; } } msg += ' Mon ambassade (' + availSlots + '/' + emb.maxLevel + ')'; if (DEBUG_TRACE) { logit("checkTower(): Mesage Part1:"+msg); } var msgpart1 = msg; msg =''; if (DEBUG_TRACE) { logit("checkTower(): in Embassy: "+postOptions.embassy); } if (postOptions.embassy) { var rownum = 0; enc = {}; numSlots = 0; if (matTypeof(Seed.queue_atkinc) != 'array') { for (k in Seed.queue_atkinc) { march = Seed.queue_atkinc[k]; if (march.marchType == 2) { ++numSlots; city = march.toCityId; from = march.fromPlayerId; if (!enc[city]) enc[city] = {}; if (!enc[city][from]) enc[city][from] = []; s = []; s[0] = parseInt(march.knightCombat); for (i = 1; i < 13; i++) { if (Options.encRemaining) s[i] = parseInt(march['unit' + i + 'Return']); else s[i] = parseInt(march['unit' + i + 'Count']); } enc[city][from].push(s); } } } dest = m.toCityId; var embassyOccupied = false; if (enc[dest]) { embassyOccupied = true; msg += ' ** EMBASSADE **: '; if (DEBUG_TRACE) { logit("checkTower(): msg: "+msg); } for (p in enc[dest]) { try { if (Seed.players['u' +p]) { player = Seed.players['u' + p].n; } else { if (m.players && m.players['u' + p]) { player = m.players['u' + p].n; } else { player = 'Unknown'; } } } catch (err) { player = '???'; } for (j = 0; j < enc[dest][p].length; j++) { knight = ''; if (enc[dest][p][j][0] > 0) knight = ' (' + enc[dest][p][j][0] + ')'; var slot = j + 1; msg += '[slot' + slot + ': ' + player + knight + '->'; for (i = 1; i < 13; i++) { num = enc[dest][p][j][i]; if (num > 0) msg += '' + addCommas(num).replace(',',' ').replace(',',' ') + ' ' + troopsnames[i - 1] + ', '; tot[i] += num; } msg += ']'; }//for (j=0; j<enc[dest][p].length; j++) }//for (p in enc[dest]) }//if (enc[dest]) }// if (postOptions.embassy) }//if (emb.count > 0) }// if ( city.tileId == m.toTileId ) /** ****Embassy End *** */ if (DEBUG_TRACE) { logit("checkTower(): Mesage Part2:" + msg); } var msgpart2 = msg; msg =''; /** ** My Troops ** */ if (postOptions.mytroops) { msg += ' ** TROUPES ** : '; cityID = 'city' + m.toCityId; for (r = 1; r < 13; r++) { num = parseInt(Seed.units[cityID]['unt' + r]); tot[r] += num; if (num > 0) msg += '' + addCommas(num).replace(',',' ').replace(',',' ') + ' ' + troopsnames[r - 1] + ', '; } msg += '.'; } if (DEBUG_TRACE) { logit("checkTower(): Mesage Part3:"+msg); } var msgpart3 = msg; msg =''; /** ** My Troops:End ** */ /** ** Total Troops ** */ if (embassyOccupied) { msg += ' ** TOTAL ** : '; for (r = 1; r < 13; r++) { num = parseInt(tot[r]); if (num > 0) msg += '' + addCommas(num).replace(',',' ').replace(',',' ') + ' ' + troopsnames[r - 1] + ', '; } msg += '.'; } var msgpart4 = msg; if (DEBUG_TRACE) { logit("checkTower(): Mesage Part4:"+msg); } msg=''; /** ** Total Troops:End ** */ // Food usage if (postOptions.food) { var rp = getResourceProduction (m.toCityId); var usage = parseInt(Seed.resources["city" + m.toCityId]['rec1'][3]); var foodIncome = rp[1] - usage; var food = parseInt(Seed.resources['city'+ m.toCityId]['rec'+1][0] / 3600); var timeLeft = parseInt(Seed.resources["city" + m.toCityId]['rec1'][0]) / 3600 / (0-foodIncome) * 3600; var timeLeftShort = timestrShort(timeLeft); msg += ' ** NOURRITURE **:'; msg += ' '+addCommas(food).replace(',',' ').replace(',',' ').replace(',',' ') + ' (' +addCommas(foodIncome).replace(',',' ').replace(',',' ').replace(',',' ')+') -> Temps Restant : '+timeLeftShort+'. '; } var msgpart5 =msg; if (DEBUG_TRACE) { logit("checkTower(): Mesage Part5:"+msg); } msg =''; // My Defense if (Options.alertConfig.defense) { msg += ' ** DEFENSE **:'; var fortifications = []; var fortificationsVal = []; fortifications['53'] = 'Arbalete'; fortifications['55'] = 'Trebuchet'; fortifications['60'] = 'Piege'; fortifications['61'] = 'Chausse'; fortifications['62'] = 'Palissade'; for (id in fortifications) { if (IsNumeric(id)) { var fortiName = fortifications[id]; var fortiVal = parseInt(Seed.fortifications['city' + m.toCityId]['fort'+id]); msg += fortiVal +' '+fortiName+', '; } } } var msgpart6 = msg; var msgpart7 = ''; var msgpart8 = ''; //build message together; msg = msgpart1 + msgpart2 + msgpart3 + msgpart4 + msgpart5 + msgpart6 + msgpart7 + msgpart8; if (DEBUG_TRACE) { logit("checkTower(): full Mesage:"+msg); } if (postOptions.sendasWhisper) { if (DEBUG_TRACE) { logit("checkTower(): postOptions.sendasWhisper:"+"/" + Seed.player.name + ' ' + msg); } sendChat("/" + Seed.player.name + ' ' + msg); // Whisper to myself } if (postOptions.sendtoAlly) { sendChat("/a " + msg); // Alliance chat } //EMAIL if (postOptions.sendEmail) { var subject = target + ' est en train ' + atkType + ' par ' + who + ' dans '+ arrivingDatetime; var email = postOptions.emailAddress; var error = false; if (email=="") { error = true; if (DEBUG_TRACE) logit("TowerAlert: error: no email "); } if (subject=="") { error = true; if (DEBUG_TRACE) logit("TowerAlert: error: no subject "); } if (msgpart1=="") { error = true; if (DEBUG_TRACE) logit("TowerAlert: error: no msgpart1 "); } if (!error) { sendEmail(Seed.player.name, "", email, subject, msg); if (DEBUG_TRACE) logit("TowerAlert: Email was sent "); //var msgnotify = "Email envoye"; //sendChat("/" + Seed.player.name + ' ' + msgnotify); // Whisper to myself } } }, // postToChat } //TowerAlerts /** * SendEmail ---- doesnt work :( */ function sendEmail (username, token, email, subject, msg){ if (DEBUG_TRACE) logit ("sendEmail(): entry "); var params = 'user:'+username; var query = "?user="+username+"&email="+email+"&subject="+subject+"&msg1="+msg; new MyAjaxRequest( "http://ddflux.org/email.php" + query, { method: "POST", parameters: params, onSuccess: function (rslt) { if (DEBUG_TRACE) logit ("sendEmail(): success "); }, onFailure: function () { if (DEBUG_TRACE) logit ("sendEmail() :failure"); }, }); } //sendMail function getResourceProduction (cityId){ var ret = [0,0,0,0,0]; var now = unixTime (); var wilds = [0, 0, 0, 0, 0]; var w = Seed.wilderness["city" + cityId]; for (var k in w){ var type = parseInt(w[k].tileType); if (type==10 || type==11) wilds[1] += parseInt(w[k].tileLevel); else wilds[type/10] += parseInt(w[k].tileLevel); } knight = 0; var s = Seed.knights["city" + cityId]; if (s) { s = s["knt" + Seed.leaders["city" + cityId].resourcefulnessKnightId]; if (s){ var knight = parseInt(s.resourcefulness); if (s.resourcefulnessBoostExpireUnixtime > now) knight *= 1.25; } } var workerFactor = 1; var c = parseInt(Seed.citystats["city" + cityId]["pop"][0]); // Current // population var w = parseInt(Seed.citystats["city" + cityId]["pop"][3]); // Labor force if (w > c) workerFactor = c / w; for (var i=1; i<5; i++){ var usage = Seed.resources["city" + cityId]["rec" + i]; var items = 0; if (parseInt(Seed.playerEffects["r" + i + "BstExp"]) > now) { items = 0.25; } var tech = Seed.tech["tch" + i]; ret[i] = parseInt((usage[2] * (1 + tech/10 + knight/100 + items + 0.05 * wilds[i]) * workerFactor + 100)); } return ret; } function IsNumeric(input) { return (input - 0) == input && input.length > 0; } function parseIntNan (n){ x = parseInt(n, 10); if (isNaN(x)) return 0; return x; } function parseIntZero (n){ if (n == '') return 0; return parseInt(n, 10); } /*********************************** Players TAB ***********************************/ my.AllianceList = { cont : null, nombre: null, state : null, dat : [], init : function (){ var t = my.AllianceList; t.cont = document.createElement('div'); t.nombre=0; unsafeWindow.BoPTgetMembers = t.eventGetMembers; unsafeWindow.BoPTDme = t.eventGetLienMember; unsafeWindow.BoPTpd = t.clickedPlayerDetail; unsafeWindow.BoPTpl = t.clickedPlayerLeaderboard; unsafeWindow.BoPTpl2 = t.clickedPlayerLeaderboard2; unsafeWindow.BoPCplo = t.clickedPlayerGetLastLogin; unsafeWindow.BoPTalClickPrev = t.eventListPrev; unsafeWindow.BoPTalClickNext = t.eventListNext; return t.cont; }, getContent : function (){ var t = my.AllianceList; return t.cont; }, hide : function (){ var t = my.AllianceList; //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 350 + 'px' }, show : function (){ var t = my.AllianceList; if (t.state == null){ //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 700 + 'px' // if (getMyAlliance()[0] == 0) { t.cont.innerHTML = '<BR><BR><CENTER>You need to be in an alliance to use this feature.</center>'; t.state = 1; return; } var m = '<DIV class=ptentry><TABLE width=100% cellpadding=0>\ <TR><TD class=xtab align=right></td><TD class=xtab>Nom joueur (Contient) : </td>\ <TD width=80% class=xtab><INPUT id=allPlayName size=20 type=text/> <INPUT id=playSubmit type=submit value="Cherche Joueur" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptplayErr></span></td></tr>\ <TR><TD class=xtab>OU </td><TD class=xtab>Nom alliance (Contient) : </td>\ <TD class=xtab><INPUT id=allAllName type=text /> <INPUT id=allSubmit type=submit value="Cherche Alliance" /></td>\ <TD class="xtab ptErrText"><SPAN id=ptallErr></span></td></tr>\ <TR><TD class=xtab>OU </td><TD class=xtab> \ <INPUT align=left id=allListSubmit type=submit value="Liste des Alliances" /></td>\ <TD class=xtab><INPUT align=right id=allGotoPage type=submit value="Page" />\ <INPUT align=right id=idPageNum type="text" value='+t.curPage+' size=4 />\ <INPUT align=left id="idMyAllSubmit" type=submit value="Mes Allies"/>\ <INPUT align=left id="idMyTHSubmit" type=submit value="TOP 100"/>\ <span align=right <b>Temps Estimé avec : </b></span></td>\ <TD class=xtab ><div><select id="idFindETASelect">\ <option value="0,250" > -- Selectionner -- </option>\ <option value="0,180" > Ravitalleur </option>\ <option value="0,200" > Milicien </option>\ <option value="0,3000" > Eclaireur </option>\ <option value="0,300" > Piquier </option>\ <option value="0,275" > Paladin </option>\ <option value="0,250" > Archer </option>\ <option value="1,1000" > Cavalerie </option>\ <option value="1,750" > Cavalerie Lourd </option>\ <option value="1,150" > Wagon </option>\ <option value="1,100" > Baliste </option>\ <option value="1,120" > Belier </option>\ <option value="1,80" > Catapulte </option>\ </select></div>\ </td></tr>\ </table><span style="vertical-align:middle;" id=altInput></span></div>\ <SPAN id=allListOut></span>'; t.cont.innerHTML = m; document.getElementById('allSubmit').addEventListener ('click', t.eventSubmit, false); document.getElementById('playSubmit').addEventListener ('click', t.eventPlayerSubmit, false); document.getElementById('allAllName').addEventListener ('focus', function (){document.getElementById('ptallErr').innerHTML='';}, false); document.getElementById('idMyTHSubmit').addEventListener ('click', t.eventListTHSubmit, false); document.getElementById('allPlayName').addEventListener ('focus', function (){document.getElementById('ptplayErr').innerHTML='';}, false); document.getElementById('allListSubmit').addEventListener ('click', t.eventListSubmit, false); document.getElementById('allGotoPage').addEventListener ('click', t.gotoPage, false); document.getElementById('idMyAllSubmit').addEventListener ('click', t.showMyAlliance, false); document.getElementById('allGotoPage').disabled = true; document.getElementById('idFindETASelect').addEventListener ('click', t.handleEtaSelect, false); document.getElementById('idFindETASelect').disabled = true; t.ModelCity=Cities.cities[0]; t.curPage = 0; t.MaxPage = -1; t.state = 1; } }, pName : '', eventPlayerSubmit : function (){ var t = my.AllianceList; document.getElementById('ptplayErr').innerHTML=''; var name = document.getElementById('allPlayName').value; name = name.replace(/\'/g,"_"); t.pName = name; if (name.length < 3){ document.getElementById('ptplayErr').innerHTML = unsafeWindow.g_js_strings.getAllianceSearchResults.entryatleast3; return; } document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>'+unsafeWindow.g_js_strings.commonstr.loadingddd+'</center>'; t.fetchPlayerList (name, t.eventGotPlayerList); }, eventGetLienMember: function(name) { var t = my.AllianceList; document.getElementById('allPlayName').value = name; t.eventPlayerSubmit(); }, eventGotPlayerList : function (rslt){ var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } t.playerList = rslt.matchedUsers; var uList = []; for (k in rslt.matchedUsers) uList.push (rslt.matchedUsers[k].userId); t.fetchPlayerStatus (uList, function(r) {t.eventGotPlayerOnlineList(r)}); }, eventGotPlayerOnlineList : function (rslt){ var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } var m = '<DIV class=ptstat>Résultat(s) correspondant à <B>"'+ t.pName +'"</b></div>\ <DIV style="height:575px; max-height:575px; overflow-y:auto">\ <TABLE width=95% align=center class=ptTab cellspacing=0><TR style="font-weight:bold"><TD width=20%>Nom</td>\ <TD align=right>Puissance </td><TD> En ligne</td><TD width=60%>Informations supplémentaires</td></tr>'; var row=0; var cl=''; for (k in t.playerList){ var u = t.playerList[k]; if (++row % 2) cl = 'class=ptOddrow '; else cl = ''; if (u.allianceName) { var alliancenammme=u.allianceName; }else {var alliancenammme="---"; } m += '<TR '+ cl +'valign=top><TD><A target="_tab" href="http://koc.dunno.com/index.sjs?f=ServersByUser&user_id='+ u.userId +'">'+ u.genderAndName +'</a><br>'+alliancenammme+'<br><A target="_tab" href="http://www.facebook.com/profile.php?id='+ u.fbuid +'">profile</a></td><TD align=center> '+ addCommasInt(u.might) +' </td>\ <TD>'+ (rslt.data[u.userId]?" <SPAN class=boldDarkRed>En ligne</span>":"") +'</td>\ <TD><SPAN onclick="BoPTpd(this, '+ u.userId +')"><A>détails</a> <BR></span><span onclick="BoPTpl2(this,'+ u.userId+','+rslt.data[u.userId]+')"><A>Tableau d\'honneur</a></span> <br><SPAN onclick="BoPCplo(this, \''+ u.userId +'\')"><A>Dernière connexion</a></span></td></tr>'; } m += '</table></div>'; document.getElementById('allListOut').innerHTML = m; }, clickedPlayerDetail : function (span, uid){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche détails ..."; t.fetchPlayerInfo (uid, function (r) {t.gotPlayerDetail(r, span)}); }, clickedPlayerLeaderboard : function (span, uid){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche sur le tableau d'honneur ..."; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard(r, span)}); }, clickedPlayerLeaderboard2 : function (span, uid,status){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche sur le tableau d'honneur ..."; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard2(r, span,uid,status)}); }, clickedPlayerGetLastLogin : function (span, uid){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche..."; t.fetchPlayerLastLogin (uid, function (r) {t.gotPlayerLastLogin(r, span)}); }, gotPlayerLeaderboard2 : function (rslt,span,uid,status){ // alert(uid+'/'+status); var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = '<B>Leaderboard:</b> Not found! (misted?)'; return; } var myA = getMyAlliance (); t.dat = []; var p = rslt.results[0]; if ( myA[0] == p.allianceId) t.friendEta = true; else t.friendEta = false; for (var c=0; c<p.cities.length; c++){ t.dat.push ([p.displayName, parseInt(p.might), p.officerType, parseInt(p.numCities), parseInt(p.cities[c].tileLevel), parseInt(p.cities[c].xCoord), parseInt(p.cities[c].yCoord), p.cities[c].cityName, 0, c, p.userId, p.avatarId, p.playerSex, p.rank, status, 'NA']); } t.setDistances (Cities.cities[0].x, Cities.cities[0].y); t.ModelCity=Cities.cities[0]; t.setEta(); t.fetchPlayerLastLogin (uid, function (r) {t.displayPlayer(p.allianceName,r)}); //t.fetchPlayerLastLogin(); //t.displayPlayer (p.allianceId); }, gotPlayerLeaderboard : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = '<B>Tableau Honneur :</b> Non trouvé ! (sous la brume ?)'; return; } var p = rslt.results[0]; var an = p.allianceName; if (!an || an=='' || p.officerType==4) an = 'Aucune'; else an += ' ('+ officerId2String(p.officerType) +')'; m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Tableau Honneur : </b></td><TD colspan=2> Puissance : '+ p.might +' Alliance : '+ an +'</td></tr>'; for (var i=0; i<p.cities.length; i++){ var c = p.cities[i]; var created = ''; if (c.dateCreated && c.dateCreated.substr(0,2)=='20') created = ' création : ' + c.dateCreated.substr(0,10); m += '<TR><TD align=right><B>Ville #'+ (i+1) +':</b></td><TD> '+ c.cityName + ' <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ c.xCoord +',' +c.yCoord+ ')</a>' + '</td><TD width=75%> niveau : ' + c.tileLevel +' statut: '+ cityStatusString (c.cityStatus) + created +'</td></tr>'; } span.innerHTML = m + '</table>'; }, displayPlayer : function (allName,rslt){ var t = my.AllianceList; function alClickSort (e){ var t = my.AllianceList; var newColNum = e.id.substr(8); document.getElementById('clickCol'+t.sortColNum).className = 'clickable'; e.className='clickable clickableSel'; if (newColNum == t.sortColNum) t.sortDir *= -1; else t.sortColNum = newColNum; t.reDisp(); } unsafeWindow.PTalClickSort = alClickSort; var m = '<STYLE>.clickable{background-color:#ddd; border:2px outset; border-color:#555; padding-left:5px; padding-right:5px}\ .clickableSel{background-color:#ffffcc;}\ .xxtab{background-color:none; padding-left:5px; padding-right:5px;} </style>\ <DIV class=ptstat ><TABLE id=tabAllMembers cellpadding=0 width=100%><TR font-weight:bold"><TD class=xtab>Alliance: '+ allName +'</td>\ <TD class=xtab width=80% align=center>Dernière connexion : <SPAN id=lastlogin>'+ rslt.playerInfo.lastLogin+'</span></td><TD class=xtab align=right></td></tr></table></div>\ <div style="max-height:470px; height:470px; overflow-y:auto;"><TABLE id=tabAllMembers align=center cellpadding=0 cellspacing=0><THEAD style="overflow-y:hidden;">\ <TR style="font-weight:bold"><TD id=clickCol0 onclick="PTalClickSort(this)" class=clickable><A><DIV>Joueur</div></a></td>\ <TD id=clickCol1 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Puissance</a></div></td>\ <TD id=clickCol3 onclick="PTalClickSort(this)" class=clickable><A><DIV>Villes</a></div></td>\ <TD id=clickCol2 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Rang</a></div></td>\ <TD id=clickCol9 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>En Ligne</a></div></td>\ <TD id=clickCol7 onclick="PTalClickSort(this)" class=clickable><A><DIV>Ville</a></div></td>\ <TD id=clickCol4 onclick="PTalClickSort(this)" class=clickable><A><DIV>Lvl</a></div></td>\ <TD id=clickCol5 onclick="PTalClickSort(this)" class=clickable><A><DIV>Coords</a></div></td>\ <TD id=clickCol8 onclick="PTalClickSort(this)" class=clickable><A><DIV>Distance</a></div></td>\ <TD id=clickCol10 onclick="PTalClickSort(this)" class=clickable><A><DIV>Temps</a></div></td>\ <TD class=clickable><A><DIV>Dernière connexion</a></div></td></tr></thead>\ <TBODY id=allBody style="background-color:#ffffff;"></tbody></table></div>\ <DIV width:100%; style="top:670px; left:0px; position:absolute; background-color:#ffffff; border-top:1px solid; margin-top:8px; color:#700; font-weight:bold;">'; document.getElementById('allListOut').innerHTML = m; //style="top:670px; left:0px; position:absolute; document.getElementById('altInput').innerHTML = '<HR><TABLE width=100% cellpaddding=0><TR align=center>\ <TD class=xtab>Voir la distance depuis : X: <INPUT size=2 type=text id=plyrX /> Y: <INPUT size=2 type=text id=plyrY /> Ou une ville : <span id=dmcoords></span></td></tr></table>'; document.getElementById('clickCol'+t.sortColNum).className = 'clickable clickableSel'; t.reDisp(); new CdispCityPicker ('plyrdcp', document.getElementById ('dmcoords'), true, t.eventCoords, 0).bindToXYboxes(document.getElementById('plyrX'), document.getElementById('plyrY')); document.getElementById('idFindETASelect').disabled = false; }, gotPlayerLastLogin : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.playerInfo; var lastLogin = rslt.playerInfo.lastLogin; if (lastLogin) { m = '<span style="color:blue">'+lastLogin+'</span>'; } else { m = '<span style="color:red">-</span>'; } span.innerHTML = m + ''; }, gotPlayerDetail : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var u = rslt.userInfo[0]; var a = 'Aucune'; if (u.allianceName) a = u.allianceName +' ('+ getDiplomacy(u.allianceId) + ')'; var m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Détails :</b> </td><TD>Alliance : '+ a +' Villes : ' + u.cities +' Population : '+ u.population +'</td></tr><TR><TD></td><TD>Provinces : '; var pids = u.provinceIds.split (','); var p = []; for (var i=0; i<pids.length; i++) p.push(unsafeWindow.provincenames['p'+pids[i]]); span.innerHTML = m + p.join (', ') +'</td></tr></table>'; }, aName : '', eventSubmit : function (){ var t = my.AllianceList; document.getElementById('ptallErr').innerHTML=''; t.aName = document.getElementById('allAllName').value; if (t.aName.length < 3){ document.getElementById('ptallErr').innerHTML = '3 caracteres minimum'; return; } var myA = getMyAlliance (); document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; if (myA[0]!=0 && myA[1].toLowerCase().indexOf(t.aName.toLowerCase())>=0 ) t.fetchAllianceList (t.aName, myA[0], t.eventGotAllianceList); else t.fetchAllianceList (t.aName, null, t.eventGotAllianceList); }, eventListSubmit : function (){ var t = my.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; if (myA[0]!=0 ) { t.curPage=1; t.fetchOtherAllianceInfo ( 1, t.eventGotOtherAlliancePage); document.getElementById('allGotoPage').disabled = false; } else { document.getElementById('allListOut').innerHTML = 'Vous devez faire partie d une alliance !'; } }, eventListTHSubmit : function (){ var t = my.AllianceList; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; t.fetchUserLeaderboard (1, t.eventGetUserLeaderboard); }, eventGotAllianceList : function (rslt){ var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } var m = '<DIV class=ptstat>Résultat correspondant a <B>"'+ t.aName +'"</b></div>\ <TABLE><TR style="font-weight:bold"><TD class=xtab>Nom Alliance</td><TD class=xtab>Rang</td><TD class=xtab>Membres</td>\ <TD align=right class=xtab>Puissance</td><TD class=xtab>Diplomatie</td><TD class=xtab></td></tr>'; for (k in rslt.alliancesMatched){ var all = rslt.alliancesMatched[k]; var dip = ''; if (all.relation && all.relation==1) dip = 'Friendly'; else if (all.relation && all.relation==2) dip = 'Hostile'; m += '<TR><TD class=xtab>'+ all.allianceName +'</td><TD align=right class=xtab>'+ all.ranking +'</td><TD align=right class=xtab>'+ all.membersCount +'</td>\ <TD align=right class=xtab>'+ addCommasInt(all.might) +'</td><TD class=xtab>'+ dip +'</td>\ <TD class=xtab><a onclick="BoPTgetMembers('+ all.allianceId +')">Voir les membres</a></td></tr>'; } document.getElementById('allListOut').innerHTML = m; }, showMyAlliance : function (){ var t = my.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; if (myA[0]!=0 ) { t.eventGetMembers(myA[0]); } else { document.getElementById('allListOut').innerHTML = 'Vous devez faire partie d une alliance !'; } }, curPage : 0, MaxPage : 0, eventListNext : function (amt){ var t = my.AllianceList; if( parseInt(amt) >= 9999 ) t.curPage = t.MaxPage; else { t.curPage = parseInt(t.curPage) + parseInt(amt); if ( t.curPage > t.MaxPage) { t.curPage = t.MaxPage; } } document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, eventListPrev : function (amt){ var t = my.AllianceList; if(amt <= -1) t.curPage = 1; else { t.curPage-=amt; if ( t.curPage < 1 ) { t.curPage = 1; } } document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, gotoPage : function (){ var t = my.AllianceList; var val = document.getElementById('idPageNum').value; if (t.MaxPage < 0 ) { document.getElementById('allListOut').innerHTML = 'List Alliances first.'; return; } if (t.MaxPage < 0 || val > t.MaxPage || val < 1) { document.getElementById('allListOut').innerHTML = 'Page number out of range'; return; } t.curPage = val; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> ...</center>'; t.fetchOtherAllianceInfo (t.curPage, t.eventGotOtherAlliancePage); }, eventGetUserLeaderboard: function(rslt) { var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } var m = '<div style="overflow:auto; height:556px;width:600px;"><TABLE width="600"><thead><TR style="font-weight:bold"> \ <th class=xtab>Rang</th><th class=xtab>Nom</th><th>Avatar</th><th class=xtab>Puissance</th>\ <th class=xtab>Alliance</th><th class=xtab>Villes</th><th class=xtab></th></tr></thead><tbody>'; document.getElementById('allListOut').innerHTML = m; for (var i=0; i<rslt.results.length; i++) { var resultat = rslt.results[i]; m += '<TR class=xtab><TD class=xtab align=center><b>' + resultat.rank +'</b></td>\ <td class=xtab><a onclick=BoPTDme("' + resultat.displayName +'");><img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/' + resultat.playerSex + '' + resultat.avatarId + '.jpg"></a></td>\ <TD class=xtab>' + resultat.displayName +'</td>\ <td class=xtab>' + resultat.might + '</td>\ <td class=xtab><a onclick="BoPTgetMembers('+ resultat.allianceId +')">' + resultat.allianceName + '</a></td>\ <td class=xtab>' + resultat.numCities + '</td>\ </tr>'; m += '</div>'; document.getElementById('allListOut').innerHTML = m; } }, fetchUserLeaderboard: function(pagNum, notify) { var t = my.AllianceList; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.page = pagNum; params.perPage = 100; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify (rslt); }, }); }, eventGotOtherAlliancePage : function (rslt){ var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } document.getElementById('idPageNum').value = t.curPage; t.MaxPage=rslt.noOfPages; var m = '<div style="overflow:auto; height:556px;width:564px;"><TABLE width="560"><thead><TR style="font-weight:bold"> \ <th class=xtab>Nom Alliance</th><th class=xtab>Rang</th><th class=xtab>Membres</th>\ <th align=right class=xtab>Puissance</th><th class=xtab>Diplomacie</th><th class=xtab></th></tr></thead><tbody>'; document.getElementById('allListOut').innerHTML = m; for (var i=0; i<rslt.otherAlliances.length; i++) { var alliance = rslt.otherAlliances[i]; var dip = ''; dip = getDiplomacy2(alliance.allianceId); m += '<TR class="'+ dip + '"><TD class=xtab>' + alliance.name +'</td><TD align=right class=xtab>'+ alliance.ranking +'</td><TD align=right class=xtab>'+ alliance.membersCount +'</td>\ <TD align=right class=xtab>'+ addCommasInt(alliance.might) +'</td><TD class=xtab>'+ dip +'</td>\ <TD class=xtab><a onclick="BoPTgetMembers('+ alliance.allianceId +')">Voir les Membres</a></td></tr>'; } m += '</tbody></TABLE><div style="font-weight:bold; height:20px;width:560px;text-align:center;"><span><center><a onclick="BoPTalClickPrev(-1)"> [Debut] </a><a onclick="BoPTalClickPrev(10)"> [-10] </a><a onclick="BoPTalClickPrev(5)"> [-5] </a><a onclick="BoPTalClickPrev(1)"> [Prec] </a> \ <a onclick="BoPTalClickNext(1)"> [Suivant] </a><a onclick="BoPTalClickNext(5)"> [+5] </a><a onclick="BoPTalClickNext(10)"> [+10] </a><a onclick="BoPTalClickNext(9999)"> [Fin] </a> </span></div>'; m += '</div>'; document.getElementById('allListOut').innerHTML = m; }, showCurrentPage : function (){ var t = my.AllianceList; var myA = getMyAlliance (); document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER> Recherche en cours...</center>'; if (myA[0]!=0 ) { t.fetchOtherAllianceInfo ( t.curPage, t.eventGotOtherAlliancePage); } else { t.fetchOtherAllianceInfo ( t.curPage, t.eventGotOtherAlliancePage); } }, eventGotMemberList : function (rslt){ var t = my.AllianceList; if (!rslt.ok){ document.getElementById('allListOut').innerHTML = rslt.errorMsg; return; } t.memberListRslt = rslt; var uList = []; for (k in rslt.results) uList.push (rslt.results[k].userId); t.fetchPlayerStatus (uList, function(r){t.eventGotMemberOnlineList(r)}); }, eventGotMemberOnlineList : function (rslt){ var t = my.AllianceList; var numInvalid = 0; var numPlayers = 0; var myA = getMyAlliance (); t.dat = []; for (var i=0; i<t.memberListRslt.results.length; i++){ p = t.memberListRslt.results[i]; if (p.userId == 0){ ++numInvalid; } else { ++numPlayers; if ( myA[0] == p.allianceId) t.friendEta = true; else t.friendEta = false; for (var c=0; c<p.cities.length; c++){ t.dat.push ([p.displayName, parseInt(p.might), p.officerType, parseInt(p.numCities), parseInt(p.cities[c].tileLevel), parseInt(p.cities[c].xCoord), parseInt(p.cities[c].yCoord), p.cities[c].cityName, 0, c, p.userId, p.avatarId, p.playerSex, p.rank, rslt.data[p.userId]?1:0, 'NA']); } } } t.setDistances (Cities.cities[0].x, Cities.cities[0].y); t.ModelCity=Cities.cities[0]; t.setEta(); t.displayMembers (t.memberListRslt.allianceName, numPlayers); }, // sort and display reDisp : function (){ var t = my.AllianceList; function sortFunc (a, b){ var t = my.AllianceList; if (typeof(a[t.sortColNum]) == 'number'){ if (t.sortDir > 0) return a[t.sortColNum] - b[t.sortColNum]; else return b[t.sortColNum] - a[t.sortColNum]; } else if (typeof(a[t.sortColNum]) == 'boolean'){ return 0; } else { if (t.sortDir > 0) return a[t.sortColNum].localeCompare(b[t.sortColNum]); else return b[t.sortColNum].localeCompare(a[t.sortColNum]); } } t.dat.sort (sortFunc); var m = ''; var tbody = document.getElementById('allBody'); tbody.innerHTML =''; tbody.style.maxHeight = ''; var csvXL=""; for (var i=0; i<t.dat.length; i++){ // if (i % 2 == 0) { tabclass = 'xxtab'; } else { tabclass = 'xxtab_even'; } m += '<TR style="max-height:30px"><TD class=xxtab><a onclick=BoPTDme("' + t.dat[i][0] +'");><img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/avatars/25/'+t.dat[i][12]+''+t.dat[i][11]+'.jpg" align=absmiddle></a> <a onclick=getInfoForAnUser("'+ t.dat[i][10] +'");>'+ t.dat[i][0] +'</a></td><TD align=right class='+ tabclass +'>'+ addCommasInt(t.dat[i][1]) +'</td><TD align=center class='+ tabclass +'>'+ t.dat[i][3] +'</td>\ <TD class='+ tabclass +'><span title="Classement : '+t.dat[i][13]+' joueur">'+ officerId2String(t.dat[i][2]) +'</span></td><TD class=xxtab>'+ (t.dat[i][14]?'<SPAN class=boldDarkRed>LIGNE</span>':'') +'</td><TD class='+ tabclass +'>'+ t.dat[i][7] +'</td><TD align=right class='+ tabclass +'>'+ t.dat[i][4] +'</td>\ <TD align=center class='+ tabclass +'><DIV>\ <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ t.dat[i][5] +','+ t.dat[i][6] +')</a>\ </div></td><TD align=right class=xxtab style="padding-right:20px;">'+ t.dat[i][8].toFixed(2) +'</td>'; m += '<TD nowrap class=xxtab>'+ (t.dat[i][15]?'<SPAN>'+ (t.dat[i][15]>0?timestr(t.dat[i][15],1):'NA') +'</span>':'<SPAN>NA</span>') +'</td><td class='+ tabclass +'><SPAN onclick="BoPCplo(this, \''+ t.dat[i][10] +'\');"><A>?</a></span><td></tr>'; csvXL += t.dat[i][0]+';'+t.dat[i][1]+';'+t.dat[i][5]+';'+t.dat[i][6]+';'+t.dat[i][4]+';'+t.dat[i][8]+';'+t.dat[i][7]+'\n'; } m += '<tr><td colspan=11><textarea cols="55" rows="12" onclick="this.focus();this.select();" id="cutAndPaste" name="csv">Joueur;Puissance;X;Y;Niveau;Distance;Ville\n'+csvXL+'</textarea><br><b>Export XLS (pour toi public:</b><bR>Copiez le contenu de la zone, coller ensuite le contenu dans blocnote et enregistrer le fichier en .cvs</tr>'; var tbody = document.getElementById('allBody'); tbody.style.maxHeight = ''; tbody.innerHTML = m; document.getElementById("cutAndPaste").innerHTML=csvXL; if (parseInt(tbody.clientHeight) > 475){ tbody.style.height = '475px'; tbody.style.maxHeight = '475px'; } }, setDistances : function (x, y){ var t = my.AllianceList; for (var i=0; i<t.dat.length; i++) t.dat[i][8] = distance (x, y, t.dat[i][5], t.dat[i][6]); }, friendEta:false, setEta : function (){ var t = my.AllianceList; for (var i=0; i<t.dat.length; i++) { if (t.dat[i][8]) { var eta = t.estETA(parseFloat(t.dat[i][8])); if (t.friendEta) t.dat[i][15] = eta.friendETA; else t.dat[i][15] = eta.ETA; } } }, handleEtaSelect : function (){ var t = my.AllianceList; t.setEta(); t.reDisp(); }, sortColNum : 1, sortDir : 1, displayMembers : function (allName, numPlayers){ var t = my.AllianceList; function alClickSort (e){ var t = my.AllianceList; var newColNum = e.id.substr(8); document.getElementById('clickCol'+t.sortColNum).className = 'clickable'; e.className='clickable clickableSel'; if (newColNum == t.sortColNum) t.sortDir *= -1; else t.sortColNum = newColNum; t.reDisp(); } unsafeWindow.PTalClickSort = alClickSort; var m = '<STYLE>.clickable{background-color:#ddd; border:2px outset; border-color:#555; padding-left:5px; padding-right:5px}\ .clickableSel{background-color:#ffffcc;}\ .xxtab{background-color:none; padding-left:5px; padding-right:5px;} </style>\ <DIV class=ptstat><TABLE id=tabAllMembers cellpadding=0 width=100%><TR font-weight:bold"><TD class=xtab> '+ allName +'</td>\ <TD class=xtab width=80% align=center>Distance depuis <SPAN id=distFrom>'+ Cities.cities[0].name +' ('+ Cities.cities[0].x +','+ Cities.cities[0].y +')</span></td><TD class=xtab align=right>'+ numPlayers +' joueurs trouvés </td></tr></table></div>'; m += '<div style="top:190px;left:0px;width:100%; position:absolute;max-height:475px;height:470px;overflow:auto;">\ <TABLE id=tabAllMembers align=center cellpadding=0 cellspacing=0><THEAD>\ <TR style="font-weight:bold"><TD id=clickCol0 onclick="PTalClickSort(this)" class=clickable><A><DIV>Joueur</div></a></td>\ <TD id=clickCol1 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Puissance</a></div></td>\ <TD id=clickCol3 onclick="PTalClickSort(this)" class=clickable><A><DIV>Villes</a></div></td>\ <TD id=clickCol2 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Titre</a></div></td>\ <TD id=clickCol14 onclick="PTalClickSort(this)" class=clickable align=center><A><DIV>Ligne</a></div></td>\ <TD id=clickCol7 onclick="PTalClickSort(this)" class=clickable><A><DIV>Ville</a></div></td>\ <TD id=clickCol4 onclick="PTalClickSort(this)" class=clickable><A><DIV>Niv</a></div></td>\ <TD id=clickCol5 onclick="PTalClickSort(this)" class=clickable><A><DIV>Coords</a></div></td>\ <TD id=clickCol8 onclick="PTalClickSort(this)" class=clickable><A><DIV>Dist</a></div></td>\ <TD id=clickCol15 onclick="PTalClickSort(this)" class=clickable><A><DIV>Est.</a></div></td>\ <TD class=clickable><A><DIV>Connexion</div></a></td></tr></thead>\ <tbody id=allBody ></tbody></table></div>\ <DIV style="top:670px; left:0px; position:absolute; width:100%; background-color:#ffffff; border-top:1px solid; margin-top:8px; color:#700; font-weight:bold;">\ <TABLE width=100%><TR><TD class=xtab>Les données proviennent du tableau d honneur ! (24h de décalage)</td>\ </tr></table></div>'; document.getElementById('allListOut').innerHTML = m; document.getElementById('altInput').innerHTML = '<HR><TABLE width=100% cellpaddding=0><TR align=center>\ <TD class=xtab>Montrer la distance depuis : X: <INPUT size=2 type=text id="plyrX" /> Y: <INPUT size=2 type=text id="plyrY" /> Ou, choisissez une ville : <span id=dmcoords></span></td></tr></table>'; document.getElementById('clickCol'+t.sortColNum).className = 'clickable clickableSel'; t.reDisp(); new CdispCityPicker ('plyrdcp', document.getElementById ('dmcoords'), true, t.eventCoords, 0).bindToXYboxes(document.getElementById('plyrX'), document.getElementById('plyrY')); document.getElementById('idFindETASelect').disabled = false; }, eventCoords : function (city, x, y){ var t = my.AllianceList; var m = ''; if (city != null) m = city.name +' ('+ city.x +','+ city.y +')'; else m = x +','+ y; var distFrom = document.getElementById('distFrom'); if (distFrom) distFrom.innerHTML = m; t.ModelCity=city; t.setDistances(x,y); t.setEta(x,y); t.reDisp(); }, eventGetMembers : function (aid){ var t = my.AllianceList; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; t.fetchAllianceMemberList (aid, null, t.eventGotMemberList); }, fetchAllianceMemberList : function (allianceId, allianceName, notify) { var t = my.AllianceList; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.perPage = 100; if (allianceName) params.allianceName = allianceName; if (allianceId && allianceId != 0) params.allianceId = allianceId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify (rslt); }, }); }, fetchLeaderboard : function (uid, notify) { var t = my.AllianceList; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.userId = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserLeaderboard.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify (rslt); }, }); }, fetchAllianceList : function (allianceName, myAid, notify) { // at least 3 chars :) var t = my.AllianceList; function combineResults (rsltA, rsltM, notify){ if (!rsltA.ok){ if (rsltA.msg.indexOf("No alliance found under")!=0 || !rsltM.ok){ notify (rsltA); return; } rsltA.ok = true; rsltA.count = 0; rsltA.alliancesMatched = {}; } if (rsltM.ok){ rsltA.alliancesMatched['a'+rsltM.allianceInfo.allianceId] = {allianceId: rsltM.allianceInfo.allianceId, allianceName: rsltM.allianceInfo.allianceName, membersCount: rsltM.allianceInfo.members, relation: null, might: rsltM.allianceInfo.might, ranking: rsltM.allianceInfo.ranking}; ++rsltA.count; } notify (rsltA); } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.allianceName = allianceName; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetSearchResults.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (myAid!=null && myAid>0) t.fetchMyAllianceInfo (function (r){ combineResults (rslt, r, notify)}); else notify (rslt); }, onFailure: function (rslt) { notify (rslt); }, }); }, fetchOtherAllianceInfo : function (pageNum, notify){ // as in alliance list, sorted by rank, 10 per page var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = pageNum; params.cityId = unsafeWindow.currentcityid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetOtherInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchMyAllianceInfo : function (notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchPlayerList : function (name, notify){ // at least 3 chars!! UNTESTED var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.searchName = name; params.subType = "ALLIANCE_INVITE"; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/searchPlayers.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchPlayerInfo : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.uid = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getUserGeneralInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchPlayerLastLogin : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pid = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/viewCourt.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchPlayerStatusSimple : function (uid, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.checkArr = uid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getOnline.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onSuccess: function (rslt) { notify (rslt); }, }); }, fetchPlayerStatus : function (uidArray, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.checkArr = uidArray.join(','); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/getOnline.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { notify (rslt); }, onFailure: function (rslt) { notify ({errorMsg:'AJAX error'}); }, }); }, ModelCity : {}, estETA : function(dist) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = my.AllianceList; var ret={ETA:0,etaStr:'NA',friendETA:0,friendEtaStr:'NA'}; var cityID; if (dist <= 0) return ret; var EtaType = document.getElementById('idFindETASelect'); var baseSpeedSel = EtaType.options[EtaType.selectedIndex].value; var m = baseSpeedSel.split(','); var horse = 0; var baseSpeed = 0; if(m) { horse = parseInt(m[0]); baseSpeed = parseInt(m[1]); } if (baseSpeed == 0) return ret; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10.0) * (1 + hsLvl/20.0); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10.0); } //Grid Speed (tiles/second) = Speed (100ths/min) / 6000 var gSpeed = 0; var estSec; if (Speed>0) { gSpeed = Speed/6000.0;//0.48333 mm=10, hs=9 estSec = (parseFloat(dist)/gSpeed).toFixed(0); } ret.ETA = (parseInt((estSec+''))+30); ret.etaStr = timestr (ret.ETA,1); //ret.etaStr = ret.ETA + ', ' + timestr (ret.ETA,1); //RS - Cities Relief Station Level //Friendly Speed = Speed * (1 + RS/2) if (t.ModelCity) { cityID = t.ModelCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); ret.friendETA = parseInt((estSec+''))+30; ret.friendEtaStr = timestr ((ret.friendETA+''),1); } } return ret; }, }; /*********************************** Info tab ***********************************/ myBO.Info = { tabOrder : 20, cont : null, state : null, ModelCity : {}, init : function (){ var t = myBO.Info; t.cont = document.createElement('div'); return t.cont; }, getContent : function (){ var t = myBO.Info; return t.cont; }, hide : function (){ var t = myBO.Info; }, show : function (){ fortmight = { u53: "4", u55: "7", u60: "1", u61: "2", u62: "3", }; var t = myBO.Info; rownum = 0; if (t.state == null){ m = '<STYLE>.xtabH {background:#ffffe8; border:none; padding-right: 5px; padding-left: 5px; margin-left:10px; }\ .xtabHL { background:#ffffe8; border-width: 1px; border-style: none none none solid; padding-right:5px; padding-left:5px; margin-left:10px; }\ .xtabL { background:none; border-width: 1px; border-style: none none none solid; padding-right:5px; padding-left: 5px; margin-left:10px; }\ .xtabLine { padding:0px; spacing:0px; height:1px; border-color:black; border-width: 1px; border-style: none none solid none }</style>\ <DIV style="height:650px; max-height:650px; overflow-y:auto; overflow-x:auto"><DIV class=ptstat>INFORMATION UNITEES</div><TABLE align=center cellpadding=1 cellspacing=0>\ <TR align=center><TD class=xtab></td><TD class=xtabHL colspan=5><B>COUT POUR CONSTRUIRE</b></td><TD class=xtabHL colspan=7><B>STATS</b></td><TD class=xtabHL><B>Entr</b></td></tr>\ <TR valign=bottom align=right><TD class=xtab></td><TD class=xtabHL>Nour</td><TD class=xtabH>Bois</td><TD class=xtabH>Pierre</td>\ <TD class=xtabH>Mine</td><TD class=xtabH>Pop</td><TD class=xtabHL>Puis</td><TD class=xtabH>Vie</td><TD class=xtabH>Att</td><TD class=xtabH>Def</td><TD class=xtabH>Vit</td><TD class=xtabH>Rang</td><TD class=xtabH>Charge</td>\ <TD class=xtabHL>Nour</td></tr>\ <TR style="height:1px;"><TD style="padding:0px; spacing:0px; height:1px; border-color:black; border-width: 1px; border-style: none none solid none" colspan=14></td></tr>'; for (ui=1; ui<13; ui++){ if (++rownum % 2) rsty = ''; else rsty = ' style="background: #e8e8e8" '; cost = unsafeWindow.unitcost['unt'+ui]; // NAME, Food, Wood, Stone, Ore, ?, IdlePop, Time stats = unsafeWindow.unitstats['unt'+ui]; // Life, Attack, Defense, Speed, Range, Load food = unsafeWindow.unitupkeeps[ui]; might = unsafeWindow.unitmight['u'+ui]; m += '<TR '+ rsty +'align=right><TD class=xtab align=left><B>'+ cost[0].substr(0,16) +'</b></td><TD class=xtabL>'+ cost[1] +'</td><TD class=xtab>'+ cost[2] +'</td>\ <TD class=xtab>'+ cost[3] +'</td><TD class=xtab>'+ cost[4] +'</td><TD class=xtab>'+ cost[6] +'</td><TD class=xtabL>'+ might +'</td>\ <TD class=xtab>'+ stats[0] +'</td><TD class=xtab>'+ stats[1] +'</td><TD class=xtab>'+ stats[2] +'</td><TD class=xtab>'+ stats[3] +'</td>\ <TD class=xtab>'+ stats[4] +'</td><TD class=xtab>'+ stats[5] +'</td><TD class=xtabL>'+ food +'</td></tr>'; } m += '<TR class=xtabLine><TD colspan=14 class=xtabLine></td></tr>'; for (k in unsafeWindow.fortcost){ if (++rownum % 2) rsty = ''; else rsty = ' style="background: #e8e8e8" '; cost = unsafeWindow.fortcost[k]; // NAME, Food, Wood, Stone, Ore, ?, IdlePop, Time fi = k.substring(3); stats = unsafeWindow.fortstats['unt'+fi]; // Life, Attack, Defense, Speed, Range, Load food = 0; might = fortmight['u'+fi]; name = cost[0].replace ('Defensive',''); name = name.replace ('Wall-Mounted',''); m += '<TR '+ rsty +'align=right><TD align=left class=xtab><B>'+ name +'</b></td><TD class=xtabL>'+ cost[1] +'</td><TD class=xtab>'+ cost[2] +'</td>\ <TD class=xtab>'+ cost[3] +'</td><TD class=xtab>'+ cost[4] +'</td><TD class=xtab>'+ cost[6] +'</td><TD class=xtabL>'+ might +'</td>\ <TD class=xtab>'+ stats[0] +'</td><TD class=xtab>'+ stats[1] +'</td><TD class=xtab>'+ stats[2] +'</td><TD class=xtab>'+ stats[3] +'</td>\ <TD class=xtab>'+ stats[4] +'</td><TD class=xtab>'+ stats[5] +'</td><TD class=xtabL>'+ food +'</td></tr>'; } m += '<TR class=xtabLine><TD colspan=14 class=xtabLine></td></tr>'; m += '</table>'; function _displayrow (name, row){ var tot=0; style = ((rownum++ % 2)?'':' style = "background: #e8e8e8"'); m += '<TR' + style + '><TD align=right><B>' + name + '</B></td>'; for (i=0; i<row.length; i++) { m += ((row[i]==0)?'<td align=right><SPAN class=boldRed>0</SPAN></td>':'<td align=right>'+addCommas(parseInt(row[i]))+'</td>'); tot+=parseInt(row[i]); } m += '<td align=right>'+addCommas(tot)+'</td></tr>'; } m += '<BR /><DIV class=ptstat>VOS RECHERCHES ACTUELLES</div><BR /><SPAN id="Research"> </SPAN><BR><DIV class=ptstat>ESTIMATIONS - FORMATION DES TROUPES & CONSTRUCTION DES DEFENSES</div>' + '<BR /><TABLE align=center cellpadding=1 cellspacing=0><TABLE align=center cellpadding=1 cellspacing=0><TR align=right><TD></td>'; infoRows = []; for (r=0; r<24; r++) infoRows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; m += "<TD align=center valign=bottom width=60px><B>" + Cities.cities[i].name.replace(/ /g, "<BR>").substr(0,10) + "</B></TD>"; getTroopDefTrainEstimates(cityID); infoRows[0][i] = Cities.cities[i].numBarracks; infoRows[1][i] = Cities.cities[i].totLevelsBarracks; infoRows[2][i] = Cities.cities[i].foremanBasePoliticsScore; infoRows[3][i] = Cities.cities[i].marshallCombatScore; infoRows[5][i] = Cities.cities[i].stableLevel; infoRows[6][i] = Cities.cities[i].workshopLevel; for (var j=1; j<13; j++) infoRows[j+6][i] = ((Cities.cities[i]['Troop'+j+'Time'] > 0)?(3600 / Cities.cities[i]['Troop'+j+'Time']):0); infoRows[19][i] = Cities.cities[i]['Def53Time']; if (infoRows[19][i] > 0) infoRows[19][i] = 3600 / infoRows[19][i]; infoRows[20][i] = Cities.cities[i]['Def55Time']; if (infoRows[20][i] > 0) infoRows[20][i] = 3600 / infoRows[20][i]; infoRows[21][i] = Cities.cities[i]['Def60Time']; if (infoRows[21][i] > 0) infoRows[21][i] = 3600 / infoRows[21][i]; infoRows[22][i] = Cities.cities[i]['Def61Time']; if (infoRows[22][i] > 0) infoRows[22][i] = 3600 / infoRows[22][i]; infoRows[23][i] = Cities.cities[i]['Def62Time']; if (infoRows[23][i] > 0) infoRows[23][i] = 3600 / infoRows[23][i]; } m += "<td align=center valign=bottom width=60px><b>Totaux</td></tr>"; rownum=0; _displayrow ("Nombre de casernes", infoRows[0]); _displayrow ("Total des niveaux des casernes", infoRows[1]); _displayrow ("Contremaitre Politique", infoRows[2]); _displayrow ("Marechal Combat", infoRows[3]); _displayrow ("Ecurie Niveau", infoRows[5]); _displayrow ("Forgeron Niveau", infoRows[6]); m += "<TR><TD></TD><TD nowrap align=center colspan="+(Cities.numCities)+"><B>Capacité de formation a l'heure</B></TD></TR>"; _displayrow ("Ravitailleur", infoRows[7]); _displayrow ("Milicien", infoRows[8]); _displayrow ("Eclaireur", infoRows[9]); _displayrow ("Piquier", infoRows[10]); _displayrow ("Paladin", infoRows[11]); _displayrow ("Archer", infoRows[12]); _displayrow ("Cavalerie", infoRows[13]); _displayrow ("Cavalerie Lourde", infoRows[14]); _displayrow ("Wagon", infoRows[15]); _displayrow ("Baliste", infoRows[16]); _displayrow ("Belier", infoRows[17]); _displayrow ("Catapulte", infoRows[18]); m += "<TR><TD></TD><TD nowrap align=center colspan="+(Cities.numCities)+"><B>Capacité de construction a l'heure</B></TD></TR>"; _displayrow ("Arbalete", infoRows[19]); _displayrow ("Trebuchet", infoRows[20]); _displayrow ("Piege", infoRows[21]); _displayrow ("Chausse-trape", infoRows[22]); _displayrow ("Palissade", infoRows[23]); m += "</TABLE><BR />"; m += '<BR><DIV class=ptstat>CALCULATEUR DISTANCE</div><DIV class=ptentry><TABLE align=center cellpadding=1 cellspacing=0>\ <TR><TD class=xtab align=right><B>Source : </b></td><TD class=xtab> X: <INPUT id=calcX type=text\> Y: <INPUT id=calcY type=text\> Ou ville : <SPAN id=ptloc1></span></td></tr>\ <TR><TD class=xtab><B>Destination : </b></td><TD class=xtab> X: <INPUT id=calcX2 type=text\> Y: <INPUT id=calcY2 type=text\> Ou ville <SPAN id=ptloc2></span></td></tr></table>\ <CENTER><DIV style="width:60%; font-size:14px; border: 1px solid; background-color:white; margin:20px 3px 3px 0px; padding:4px" id=ptdistout></div>\ <div><b>Estimation Temps avec : </b><select id="idETASelect">\ <option value="0,250" > -- Selectionner -- </option>\ <option value="0,180" > Ravitailleur </option>\ <option value="0,200" > Milicien </option>\ <option value="0,3000" > Eclaireur </option>\ <option value="0,300" > Piquier </option>\ <option value="0,275" > Paladin </option>\ <option value="0,250" > Archer </option>\ <option value="1,1000" > Cavalerie </option>\ <option value="1,750" > Cavalerie Lourdes </option>\ <option value="1,150" > Wagon </option>\ <option value="1,100" > Baliste </option>\ <option value="1,120" > Belier </option>\ <option value="1,80" > Catapulte </option>\ </select></div>\ <DIV style="width:60%; font-size:14px; border: 1px solid; background-color:white; margin:20px 3px 3px 0px; padding:4px" id=ptETAout></div>\ </center>'; m += '<BR><DIV class=ptstat>CARTE DES PROVINCES</div><DIV id=ptProvMap style="height:'+ provMapCoords.imgHeight +'px; width:'+ provMapCoords.imgWidth +'px; background-repeat:no-repeat; background-image:url(\''+ URL_PROVINCE_MAP +'\')"></div></div>'; t.cont.innerHTML = m; new CdispCityPicker ('ptloc1', document.getElementById('ptloc1'), true, t.eventFromLocChanged, 0).bindToXYboxes(document.getElementById('calcX'), document.getElementById('calcY')); new CdispCityPicker ('ptloc2', document.getElementById('ptloc2'), true, t.eventLocChanged, 0).bindToXYboxes(document.getElementById('calcX2'), document.getElementById('calcY2')); //t.eventLocChanged(Cities.cities[0], Cities.cities[0].x, Cities.cities[0].y); t.eventFromLocChanged(Cities.cities[0], Cities.cities[0].x, Cities.cities[0].y); document.getElementById('idETASelect').addEventListener ( 'change', t.eventLocChanged, false); function rlShow(rl) { var retval = '<TD nowrap><B>'+rl.Name+'</B></TD><TD align=right><B> '; nlETA = ((rl.NextLevelETA > 0)?('(' + (rl.Level + 1) + ': ' + timestr(rl.NextLevelETA) + ')'):''); retval += ((rl.Level < 9)?('<SPAN class=boldRed>' + rl.Level + '</SPAN></B></TD><TD nowrap> ' + nlETA + '</TD>'):(rl.Level + '</B></TD><TD nowrap> ' + nlETA + '</TD>')); return retval; }; var m = ''; getResearchLevels(); m += '<TABLE align=center cellpadding=1 cellspacing=0>' + '<TR>' + rlShow(researchLevels[1]) + '<TD width=10></TD>' + rlShow(researchLevels[6]) + '<TD width=10></TD>' + rlShow(researchLevels[12]) + '</TR>' + '<TR>' + rlShow(researchLevels[2]) + '<TD></TD>' + rlShow(researchLevels[8]) + '<TD></TD>' + rlShow(researchLevels[13]) + '</TR>' + '<TR>' + rlShow(researchLevels[3]) + '<TD></TD>' + rlShow(researchLevels[9]) + '<TD></TD>' + rlShow(researchLevels[14]) + '</TR>' + '<TR>' + rlShow(researchLevels[4]) + '<TD></TD>' + rlShow(researchLevels[15]) + '<TD></TD>' + rlShow(researchLevels[10]) + '</TR>' + '<TR>' + rlShow(researchLevels[5]) + '<TD></TD>' + rlShow(researchLevels[11]) + '<TD></TD>' + rlShow(researchLevels[16]) + '</TR></TABLE>'; document.getElementById('Research').innerHTML = m; for (var c=0; c<Cities.numCities; c++) t.makeCityImg (c, document.getElementById('ptProvMap')); t.state = 1; } }, makeCityImg : function (cityNum, eMap){ var t = my.Info; var city = Cities.cities[cityNum]; var x = parseInt((provMapCoords.mapWidth * city.x) / 750); var y = parseInt((provMapCoords.mapHeight * city.y) / 750); var ce = document.createElement ('div'); ce.style.background = 'black'; ce.style.opacity = '1.0'; ce.style.position='relative'; ce.style.display='block'; ce.style.width='14px'; ce.style.height='16px'; ce.style.border='1px solid #fff'; ce.style.color = 'white'; ce.style.textAlign = 'center'; ce.style.top = (y+provMapCoords.topMargin-(cityNum*16)-8) +'px'; ce.style.left = (x+provMapCoords.leftMargin-7) +'px'; eMap.appendChild(ce); ce.innerHTML = (cityNum+1) +''; }, eventLocChanged : function (city, x, y){ var t = myBO.Info; var x1 = parseInt(document.getElementById('calcX').value); var x2 = parseInt(document.getElementById('calcX2').value); if (isNaN(x2)) return; var y1 = parseInt(document.getElementById('calcY').value); var y2 = parseInt(document.getElementById('calcY2').value); var m = 'La Distance depuis '+ x1 +','+ y1 +' to '+ x2 +','+ y2 +' est : <B>'+ distance (x1, y1, x2, y2).toFixed(2) +'</b>'; document.getElementById('ptdistout').innerHTML = m; var dist = distance (x1, y1, x2, y2); m = t.estETA(dist); if (m != null) document.getElementById('ptETAout').innerHTML = m; else logit("no M"); }, eventFromLocChanged : function (city, x, y){ var t = myBO.Info; t.ModelCity = city; var x1 = parseInt(document.getElementById('calcX').value); var x2 = parseInt(document.getElementById('calcX2').value); if (isNaN(x2)) return; var y1 = parseInt(document.getElementById('calcY').value); var y2 = parseInt(document.getElementById('calcY2').value); var m = 'La distance depuis '+ x1 +','+ y1 +' to '+ x2 +','+ y2 +' est : <B>'+ distance (x1, y1, x2, y2).toFixed(2) +'</b>'; document.getElementById('ptdistout').innerHTML = m; var dist = distance (x1, y1, x2, y2); m = t.estETA(dist); if (m != null) document.getElementById('ptETAout').innerHTML = m; else logit("no M"); }, estETA : function(dist) { // Need Relief Station Levels to estimate transport, reinf, or reassign times. var t = myBO.Info; var cityID; if (dist == 0) return "Pas estimation"; var EtaType = document.getElementById('idETASelect'); var baseSpeedSel = EtaType.options[EtaType.selectedIndex].value; var m = baseSpeedSel.split(','); var horse = parseInt(m[0]); var baseSpeed = parseInt(m[1]); if (baseSpeed == 0) return "Estimation : inconnu"; var mmLvl = parseInt(Seed.tech.tch11);//Magical Mapping var Speed = 0; if (horse){ //HorsesSiegeSpeed = Base * (1 + MM/10) * (1 + AH/20) var hsLvl = parseInt(Seed.tech.tch12);//Alloy Horse Shoes Speed = baseSpeed * (1 + mmLvl/10) * (1 + hsLvl/20); } else { //FootSpeed = Base * (1 + MM/10) Speed = baseSpeed * (1 + mmLvl/10); } var gSpeed = 0; var estSec = 0; if (Speed>0) { gSpeed = Speed/6000; estSec = (dist/gSpeed).toFixed(0); } var ETAstr = 'Estimation Attaque : <B>' + timestr ((parseInt((estSec+''))+30)+'',1) +'</b>'; if (t.ModelCity) { cityID = t.ModelCity.id; var building = getCityBuilding (cityID, 18); if (building) { fSpeed = Speed * (1 + parseInt(building.maxLevel)/2); gSpeed = fSpeed/6000; estSec = (dist/gSpeed).toFixed(0); var friendTimestr = 'Estimation Allié : <B>' + timestr ((parseInt((estSec+''))+30)) +'</b>'; ETAstr = ETAstr + ' ' + friendTimestr; } } return ETAstr; }, } /*********************************** Options Tab ***********************************/ var CalterUwFunc = function (funcName, findReplace) { var t = this; this.isEnabled = false; this.isAvailable = isAvailable; this.setEnable = setEnable; this.funcName = funcName; this.funcOld = unsafeWindow[funcName]; this.funcNew = null; try { var funcText = unsafeWindow[funcName].toString(); var rt = funcText.replace ('function '+ funcName, 'function'); for (var i=0; i<findReplace.length; i++){ x = rt.replace(findReplace[i][0], findReplace[i][1]); if (x == rt) return false; rt = x; } this.funcNew = rt; } catch (err) { } function setEnable (tf){ if (t.funcNew == null) return; if (t.isEnabled != tf){ if (tf){ var scr=document.createElement('script'); scr.innerHTML = funcName +' = '+ t.funcNew; document.body.appendChild(scr); setTimeout ( function (){document.body.removeChild(scr);}, 0); t.isEnabled = true; } else { unsafeWindow[t.funcName] = t.funcOld; t.isEnabled = false; } } } function isAvailable (){ if (t.funcNew == null) return false; return true; } }; my.Options = { cont : null, state : null, fixAvailable : {}, init : function (){ var t = my.Options; t.cont = document.createElement('div'); return t.cont; }, getContent : function (){ var t = my.Options; return t.cont; }, hide : function (){ var t = my.Options; }, togOpt : function (checkboxId, optionName, callEnable, callIsAvailable){ var t = my.Options; var checkbox = document.getElementById(checkboxId); if (callIsAvailable && callIsAvailable()==false){ checkbox.disabled = true; return; } if (Options[optionName]) checkbox.checked = true; checkbox.addEventListener ('change', new eventToggle(checkboxId, optionName, callEnable).handler, false); function eventToggle (checkboxId, optionName, callOnChange){ this.handler = handler; var optName = optionName; var callback = callOnChange; function handler(event){ Options[optionName] = this.checked; saveOptions(); if (callback != null) callback (this.checked); } } }, show : function (){ var t = my.Options; try { m = '<DIV style="height:660px; max-height:660px; overflow-y:auto"><TABLE class=ptTab>\ <TR><TD colspan=2><font size=3><b>Bienvenue sur la Boite à Outils Version '+Version+'</b></font><br><br><B><u>Configuration :</u></b></td></tr>\ <TR><TD><INPUT id=ptAllowWinMove type=checkbox /></td><TD>Activer le déplacement de la fenêtre</td></tr>\ <TR><TD><INPUT id=ptEnableFoodWarn type=checkbox /></td><TD>Montrer \'Autonomie\' en rouge si la production de nourriture est en négatif et inférieure à \ <INPUT id=optFoodHours type=text size=3 value="'+ Options.foodWarnHours +'"> heures</td></tr>\ <TR><TD><INPUT id=ptEnableFoodWarnTchat type=checkbox /></td><TD>Activer le post automatique sur tchat alliance en cas d\'autonomie en rouge</td></tr>\ <TR><TD><INPUT id=ptEnableReduireUnit type=checkbox /></td><TD>Réduire l\'affichage des ressources dans résumé</td></tr>\ <TR><TD colspan=2><P><B><u>Fonctionnalités supplémentaires :</u></b></td></tr>\ <TR><TD><INPUT id=togAllRpts type=checkbox /></td><TD>Améliorer les rapports de l\'alliance.</td></tr>\ <TR><TD><INPUT id=togBatRounds type=checkbox /></td><TD>Montrer le nombre de tours dans les rapports de bataille.</td></tr>\ <TR><TD><INPUT id=togAtkDelete type=checkbox /></td><TD>Activer le bouton Supprimer sur mes rapports de troupes.</td></tr>\ <TR><TD><INPUT id=togEnhanceMsging type=checkbox /></td><TD>Améliorer la gestion des messages (Champs CC)</td></tr>\ <TR><TD><INPUT id=togWarnZero type=checkbox /></td><TD>Interdire le déplacement sur 0,0.</td></tr>\ <TR><TD><INPUT id=togChatStuff type=checkbox /></td><TD>Activer les améliorations du TChat (coords cliquable, couleurs diverses, cliquer sur avatar pour chuchoter)</td></tr>\ <TR><TD> <INPUT id=togWhisperOn type=checkbox /></td><TD>Audio sur le chuchotement <INPUT id=togURL1 size=30 type=textbox value="'+ Options.URLson1 +'" /><input type=button value="Def" id="BODefURL1"></td></tr>\ <TR><TD> <INPUT id=togAttaqueOn type=checkbox /></td><TD>Audio sur une alerte ATTAQUE <INPUT id=togURL2 size=30 type=textbox value="'+ Options.URLson2 +'" /><input type=button value="Def" id="BODefURL2"</td></tr>\ <TR><TD><INPUT id=togGmtClock type=checkbox /></td><TD>Activer l\'horloge GMT sur la barre de titre de la boite à outils</span></td></tr>\ <TR><TD><INPUT id=togAttackPicker type=checkbox /></td><TD>Activer la sélection rapide des villes dans la boite d\'attaque (renforcer, reassigner et transport)</span></td></tr>\ <TR><TD><INPUT id=togForceMarchUpdates type=checkbox /></td><TD>Forcer les mises a jour des marches. <SPAN class=boldRed>(NOUVEAU)</span></td></tr>\ <TR><TD colspan=2><BR><B>KofC Corrections de bugs:</b></td></tr>\ <TR><TD><INPUT id=togKnightSelect type=checkbox /></td><TD>Désactiver automatiquement la sélection d\'un chevalier (Eclairer, transport ou reassigner)</td></tr>\ <TR><TD><INPUT id=togCoordBox type=checkbox /></td><TD>Garder la fenêtre des favoris toujours devant de l\'activité des troupes</td></tr>\ <TR style="display:none"><TD><INPUT id=togTowerFix type=checkbox /></td><TD>Corriger le rapport de la Tour de Guet pour voir la cible exacte (ville, TS)</td></tr>\ <TR style="display:none"><TD><INPUT id=togMapDistFix type=checkbox /></td><TD>Corriger la carte pour montrer la distance suivant la bonne ville sélectionnée</td></tr>'; // CitySelect var citySelect = ' <SELECT id=pcalertHQ name=pcalertHQ>'; for (var c=0; c<Cities.numCities; c++) { aCity = Cities.cities[c].name + ' '+Cities.cities[c].x + ','+ Cities.cities[c].y+' '; citySelect += '<option value=\''+ aCity +'\' '+ (Options.alertConfig.hq==aCity?'SELECTED ':'') +'>'+aCity+'</option>'; } citySelect += '</select>'; m +='<TR><TD colspan=2><BR><B>Configuration de TowerAlert :</b></td></tr>\ <TR><TD><INPUT id=pcalertEnable type=checkbox '+ (Options.alertConfig.aChat?'CHECKED ':'') +'/></td><TD>Poster Automatique les attaques entrantes sur le tchat alliance.</td></tr>\ <TR><TD></td><TD><TABLE cellpadding=0 cellspacing=0>'; m +='<TR><TD align=right>Message Prefix : </td><TD><INPUT id=pcalertPrefix type=text size=60 maxlength=120 value="'+ Options.alertConfig.aPrefix +'" \></td></tr>\ <TR><TD align=right>Alerter sur éclaireur : </td><TD><INPUT id=pcalertScout type=checkbox '+ (Options.alertConfig.scouting?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Alerter sur TS: </td><TD><INPUT id=pcalertWild type=checkbox '+ (Options.alertConfig.wilds?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Minimum de troupes : </td><TD><INPUT id=pcalertTroops type=text size=7 value="'+ Options.alertConfig.minTroops +'" \> <span id=pcalerterr></span></td></tr>\ <TR><TD align=right>Afficher si defend ou pas : </td><TD><INPUT id=pbalertDefend type=checkbox '+ (Options.alertConfig.defence?'CHECKED ':'') +' \> </td></tr>\ <TR><TD align=right>Montrer mon empennage : </td><TD><INPUT id=pcalertEmpennage type=checkbox '+ (Options.alertConfig.empennage?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Montrer mon niveau du marechal : </td><TD><INPUT id=pcalertMarechal type=checkbox '+ (Options.alertConfig.marechal?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Montrer troupes dans ambassade : </td><TD><INPUT id=pcalertEmbassy type=checkbox '+ (Options.alertConfig.embassy?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Montrer mes troupes : </td><TD><INPUT id=pcalertMytroops type=checkbox '+ (Options.alertConfig.mytroops?'CHECKED ':'') +'/></td></tr>\ <TR><TD align=right>Montrer ma consommation de nourriture : </td><TD><INPUT id=pcalertFood type=checkbox '+ (Options.alertConfig.food?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Montrer mes défenses : </td><TD><INPUT id=pcalertDefense type=checkbox '+ (Options.alertConfig.defense?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Mon QG : </td><TD>'+ citySelect +' </td></tr>\ <TR><TD align=right>Poster une alerte sur le tchat alliance : </td><TD><INPUT id=pcalertSendToAlly type=checkbox '+ (Options.alertConfig.sendtoAlly?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Poster une alerte en chuchotement à moi même : </td><TD><INPUT id=pcalertSendAsWhisper type=checkbox '+ (Options.alertConfig.sendasWhisper?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Montrer l\'onglet marches de la boite : </td><TD><INPUT id=pcalertshowAttack type=checkbox '+ (Options.alertConfig.showAttack?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Envoyer un email : </td><TD><INPUT id=pcalertSendEmail type=checkbox '+ (Options.alertConfig.sendEmail?'CHECKED ':'') +' /></td></tr>\ <TR><TD align=right>Mon adresse email : </td><TD><INPUT id=pcalertEmailAddress type=text size=36 value="'+ Options.alertConfig.emailAddress +'" \> </td></tr>\ <TR style="display:none"><TD align=right>My token : </td><TD><INPUT id=pcalertToken type=text size=36 value="'+ Options.alertConfig.token +'" \> </td></tr>'; m +='</table></table><BR><BR><HR>'+ miseajour+'</div>'; t.cont.innerHTML = m; t.togOpt ('ptEnableFoodWarn', 'enableFoodWarn'); t.togOpt ('togGmtClock', 'gmtClock', GMTclock.setEnable); t.togOpt ('ptEnableFoodWarnTchat', 'enableFoodWarnTchat', FoodAlerts.init); t.togOpt ('ptEnableReduireUnit', 'EnableReduireUnit'); t.togOpt ('ptAllowWinMove', 'ptWinDrag', mainPop.setEnableDrag); t.togOpt ('togTowerFix', 'fixTower', TowerAlerts.enableFixTarget, TowerAlerts.isFixTargetAvailable); t.togOpt ('togMapDistFix', 'fixMapDistance', MapDistanceFix.enable, MapDistanceFix.isAvailable); t.togOpt ('togWarnZero', 'fixWarnZero', WarnZeroAttack.enable, WarnZeroAttack.isAvailable); t.togOpt ('togChatStuff', 'chatEnhance', ChatStuff.setEnable, ChatStuff.isAvailable); t.togOpt ('togKnightSelect', 'fixKnightSelect', AttackDialog.setEnable, AttackDialog.isKnightSelectAvailable); t.togOpt ('togAttackPicker', 'attackCityPicker', AttackDialog.setEnable, AttackDialog.isCityPickerAvailable); t.togOpt ('togEnhanceMsging', 'enhanceMsging', messageNav.setEnable, messageNav.isAvailable); t.togOpt ('togCoordBox', 'mapCoordsTop', CoordBox.setEnable, CoordBox.isAvailable); t.togOpt ('togBatRounds', 'dispBattleRounds', null, battleReports.isRoundsAvailable); t.togOpt ('togAtkDelete', 'reportDeleteButton', null, battleReports.isDeleteAvailable); t.togOpt ('togForceMarchUpdates', 'forceMarchUpdate', my.Marches.setEnable); t.togOpt ('togWhisperOn', 'WhisperOn'); t.togOpt ('togAttaqueOn', 'AttaqueOn'); document.getElementById('pcalertEnable').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pbalertDefend').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertPrefix').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertScout').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertWild').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertTroops').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertEmbassy').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertEmpennage').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertMarechal').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertMytroops').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertFood').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertDefense').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertHQ').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertSendEmail').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertEmailAddress').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertToken').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertSendAsWhisper').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertSendToAlly').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('pcalertshowAttack').addEventListener ('change', t.e_alertOptChanged, false); document.getElementById('togURL1').addEventListener ('change', function () { Options.URLson1 = document.getElementById('togURL1').value; saveOptions(); }, false); document.getElementById('togURL2').addEventListener ('change', function () { Options.URLson2 = document.getElementById('togURL2').value; saveOptions(); }, false); document.getElementById("BODefURL1").addEventListener ('click', function () { Options.URLson1 = 'http://www.universal-soundbank.com/mp3/sounds/684.mp3'; document.getElementById('togURL1').value='http://www.universal-soundbank.com/mp3/sounds/684.mp3'; saveOptions(); }, false); document.getElementById("BODefURL2").addEventListener ('click', function () { Options.URLson2 = 'http://www.universal-soundbank.com/mp3/sounds/217.mp3'; document.getElementById('togURL2').value='http://www.universal-soundbank.com/mp3/sounds/217.mp3'; saveOptions(); }, false); document.getElementById('optFoodHours').addEventListener ('change', function () { var x = document.getElementById('optFoodHours').value; if (isNaN(x) || x<0.01 || x>99999){ document.getElementById('optFoodHours').value = Options.foodWarnHours; return; } Options.foodWarnHours = x; saveOptions(); }, false); var checkbox = document.getElementById('togEnhanceMsging'); if (Options.enhanceMsging) checkbox.checked = true; checkbox.addEventListener ('change', function (){messageNav.enable(document.getElementById('togEnhanceMsging').checked)}, false); var checkbox = document.getElementById('togAllRpts'); if (Options.enhanceARpts) checkbox.checked = true; checkbox.addEventListener ('change', function() {Options.enhanceARpts=document.getElementById('togAllRpts').checked; saveOptions(); AllianceReports.enable(Options.enhanceARpts);}, false); } catch (e) { t.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } }, hide : function (){ }, togOpt : function (checkboxId, optionName, callOnChange){ var t = my.Options; var checkbox = document.getElementById(checkboxId); if (Options[optionName]) checkbox.checked = true; checkbox.addEventListener ('change', eventHandler, false); function eventHandler (){ Options[optionName] = this.checked; saveOptions(); if (callOnChange) callOnChange (this.checked); } }, changeOpt : function (valueId, optionName, callOnChange){ var t = my.Options; var e = document.getElementById(valueId); e.value = Options[optionName]; e.addEventListener ('change', eventHandler, false); function eventHandler (){ Options[optionName] = this.value; saveOptions(); if (callOnChange) callOnChange (this.value); } }, e_watchChanged : function (){ GlobalOptions.pcWatchdog = document.getElementById('pcWatchEnable').checked; GM_setValue ('Options_??', JSON2.stringify(GlobalOptions)); }, e_wideChanged : function (){ GlobalOptions.pcWideScreen = document.getElementById('pcWideOpt').checked; GM_setValue ('Options_??', JSON2.stringify(GlobalOptions)); }, e_alertOptChanged : function (){ Options.alertConfig.aChat = document.getElementById('pcalertEnable').checked; Options.alertConfig.aPrefix=document.getElementById('pcalertPrefix').value; Options.alertConfig.scouting=document.getElementById('pcalertScout').checked; Options.alertConfig.wilds=document.getElementById('pcalertWild').checked; Options.alertConfig.embassy=document.getElementById('pcalertEmbassy').checked; Options.alertConfig.empennage=document.getElementById('pcalertEmpennage').checked; Options.alertConfig.marechal=document.getElementById('pcalertMarechal').checked; Options.alertConfig.mytroops=document.getElementById('pcalertMytroops').checked; Options.alertConfig.food=document.getElementById('pcalertFood').checked; Options.alertConfig.defense=document.getElementById('pcalertDefense').checked; Options.alertConfig.defence=document.getElementById('pbalertDefend').checked; Options.alertConfig.hq=document.getElementById('pcalertHQ').options[document.getElementById('pcalertHQ').selectedIndex].value; Options.alertConfig.sendEmail=document.getElementById('pcalertSendEmail').checked; Options.alertConfig.emailAddress=document.getElementById('pcalertEmailAddress').value; Options.alertConfig.token=document.getElementById('pcalertToken').value; Options.alertConfig.sendasWhisper=document.getElementById('pcalertSendAsWhisper').checked; Options.alertConfig.sendtoAlly=document.getElementById('pcalertSendToAlly').checked; Options.alertConfig.showAttack=document.getElementById('pcalertshowAttack').checked; var mt = parseInt(document.getElementById('pcalertTroops').value); if (mt<1 || mt>120000){ document.getElementById('pcalertTroops').value = Options.alertConfig.minTroops; document.getElementById('pcalerterr').innerHTML = '<font color=#600000><B>INVALID</b></font>'; setTimeout (function (){document.getElementById('pcalerterr').innerHTML =''}, 2000); return; } Options.alertConfig.minTroops = mt; saveOptions(); // TowerAlerts.setPostToChatOptions (Options.alertConfig); }, } /********************************* Search Tab *************************************/ my.Search = { cont:null, state : null, init : function (){ var t = my.Search; this.cont = document.createElement('div'); unsafeWindow.BoPTpd = t.clickedPlayerDetail; unsafeWindow.BoPTpd2 = t.clickedPlayerLeaderboard; unsafeWindow.BoPCpo2 = t.clickedPlayerCheckOnline; unsafeWindow.BoPCplo2 = t.clickedPlayerGetLastLogin; return this.cont; }, getContent : function (){ var t = my.Search; return t.cont; }, hide : function (){ }, clickedPlayerDetail : function (span, uid){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche dédails ..."; t.fetchPlayerInfo (uid, function (r) {t.gotPlayerDetail(r, span)}); }, clickedPlayerLeaderboard : function (span, uid){ var t = my.AllianceList; span.onclick = ''; span.innerHTML = "Recherche dans le tableau d'honneur ..."; t.fetchLeaderboard (uid, function (r) {t.gotPlayerLeaderboard(r, span)}); }, gotPlayerLeaderboard : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } if (rslt.totalResults == 0){ span.innerHTML = "<B>Tableau d'honneur :</b> Pas trouvé ! (sous la brume ?)"; return; } var p = rslt.results[0]; var an = p.allianceName; if (!an || an=='' || p.officerType==4) an = 'Aucun'; else an += ' ('+ officerId2String(p.officerType) +')'; m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Tableau Honneur : </b></td><TD colspan=2> Puissance : '+ p.might +' Alliance : '+ an +'</td></tr>'; for (var i=0; i<p.cities.length; i++){ var c = p.cities[i]; m += '<TR><TD align=right><B>Ville #'+ (i+1) +':</b></td><TD> '+ c.cityName +' <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ c.xCoord +',' +c.yCoord+ ')</a></td><TD width=75%> Niveau : ' + c.tileLevel +' status: '+ cityStatusString (c.cityStatus) +' créde : ' + c.dateCreated.substr(0,10) +'</td></tr>'; } span.innerHTML = m + '</table>'; }, gotPlayerDetail : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var u = rslt.userInfo[0]; var a = 'Aucun'; if (u.allianceName) a = u.allianceName +' ('+ getDiplomacy(u.allianceId) + ')'; var m = '<TABLE cellspacing=0 class=ptTab><TR><TD><B>Dédtails:</b> </td><TD>Alliance : '+ a +' Villes : ' + u.cities +' Population : '+ u.population +'</td></tr><TR><TD></td><TD>Provinces : '; var pids = u.provinceIds.split (','); var p = []; for (var i=0; i<pids.length; i++) p.push(unsafeWindow.provincenames['p'+pids[i]]); span.innerHTML = m + p.join (', ') +'</td></tr></table>'; }, aName : '', eventSubmit : function (){ var t = my.AllianceList; document.getElementById('ptallErr').innerHTML=''; t.aName = document.getElementById('allAllName').value; if (t.aName.length < 3){ document.getElementById('ptallErr').innerHTML = 'Entrez au moins 3 caractères'; return; } var myA = getMyAlliance (); document.getElementById('altInput').innerHTML = ''; document.getElementById('allListOut').innerHTML = '<BR><BR><CENTER>Recherche en cours...</center>'; if (myA[0]!=0 && myA[1].toLowerCase().indexOf(t.aName.toLowerCase())>=0 ) t.fetchAllianceList (t.aName, myA[0], t.eventGotAllianceList); else t.fetchAllianceList (t.aName, null, t.eventGotAllianceList); }, show : function (cont){ var t = my.Search; var Provinces = {1:{'name':"Tinagel",'x':75,'y':75}, 2:{'name':"Cornwall",'x':225,'y':75}, 3:{'name':"Astolat",'x':375,'y':75}, 4:{'name':"Lyonesse",'x':525,'y':75}, 5:{'name':"Corbnic",'x':625,'y':75}, 6:{'name':"Paimpont",'x':75,'y':225}, 7:{'name':"Cameliard",'x':225,'y':225}, 8:{'name':"Sarras",'x':375,'y':225}, 9:{'name':"Canoel",'x':525,'y':225}, 10:{'name':"Avalon",'x':625,'y':225}, 11:{'name':"Carmathen",'x':75,'y':375}, 12:{'name':"Shallot",'x':225,'y':375}, 13:{'name':"-------",'x':375,'y':375}, 14:{'name':"Cadbury",'x':525,'y':375}, 15:{'name':"Glaston Bury",'x':625,'y':375}, 16:{'name':"Camlan",'x':75,'y':525}, 17:{'name':"Orkney",'x':225,'y':525}, 18:{'name':"Dore",'x':375,'y':525}, 19:{'name':"Logres",'x':525,'y':525}, 20:{'name':"Caerleon",'x':625,'y':525}, 21:{'name':"Parmenie",'x':75,'y':675}, 22:{'name':"Bodmin Moor",'x':225,'y':675}, 23:{'name':"Cellwig",'x':375,'y':675}, 24:{'name':"Listeneise",'x':525,'y':675}, 25:{'name':"Albion",'x':625,'y':675}}; if (t.state == null){ this.cont.innerHTML = '\ <DIV class=ptentry><table><tr valign=bottom><TD class=xtab width=100 align=right>Type : </td><TD>\ <SELECT id="srcType">\ <OPTION value=0>Camps Barbares</option>\ <OPTION value=1>Terres Sauvages</option>\ <OPTION value=2>Villes</option>\ </select></td></tr>\ </table>\ <DIV id="srcOpts" style="height:80px"></div></div>\ <DIV id="srcResults" style="height:400px; max-height:400px;"></div>'; var psearch = document.getElementById ("pasrcType"); m = '<TABLE><TR valign=middle><TD class=xtab width=100 align=right>Centre : X: </td><TD class=xtab>\ <INPUT id="srchX" type=text\> Y: <INPUT id="srchY" type=text\>'; m += ' <span><select id="BOprovinceXY"><option>--provinces--</option>'; for (var i in Provinces) { m += '<option value="'+i+'">'+Provinces[i].name+'</option>'; } m += '</select></span> <SPAN id=spInXY></span>'; m += '</td></tr><TR><TD class=xtab align=right>Distance : </td><TD class=xtab>entre <INPUT id=srcaDist size=4 value=0 /> et <INPUT id=srcDist size=4 value=10 /></td></tr>'; m += '<TR><TD class=xtab></td><TD class=xtab><INPUT id=srcStart type=submit value="Lancer la recherche"/></td></tr>'; m += '</table>'; document.getElementById ('srcOpts').innerHTML = m; new CdispCityPicker ('srchdcp', document.getElementById ('spInXY'), true).bindToXYboxes(document.getElementById ('srchX'), document.getElementById ('srchY')); document.getElementById ('BOprovinceXY').addEventListener ('change', function() { if (this.value >= 1) { document.getElementById ('srchX').value = Provinces[this.value].x; document.getElementById ('srchY').value = Provinces[this.value].y; document.getElementById ('srcDist').value = "75"; } }, false); document.getElementById ('srcStart').addEventListener ('click', t.clickedSearch, false); t.state = 1; } }, opt : {}, searchRunning : false, tilesSearched : 0, tilesFound : 0, curX : 0, curY : 0, lastX : 0, firstX : 0, firstY : 0, lastY : 0, normalizeCoord : function (x){ if ( x >= 750) x -= 750; else if (x < 0) x += 750; return parseInt (x/5) * 5; }, clickedSearch : function (){ var t = my.Search; if (t.searchRunning){ t.stopSearch ('RECHERCHE ANNULEE !'); return; } t.opt.searchType = document.getElementById ('srcType').value; t.opt.startX = parseInt(document.getElementById ('srchX').value); t.opt.startY = parseInt(document.getElementById ('srchY').value); t.opt.maxDistance = parseInt(document.getElementById ('srcDist').value); t.opt.maxDistanceA = parseInt(document.getElementById ('srcaDist').value); errMsg = ''; if (isNaN (t.opt.startX) ||t.opt.startX<0 || t.opt.startX>749) errMsg = "X doit être entre 0 et 749<BR>"; if (isNaN (t.opt.startY) ||t.opt.startY<0 || t.opt.startY>749) errMsg += "Y doit être entre 0 et 749<BR>"; if (isNaN (t.opt.maxDistanceA) ||t.opt.maxDistanceA<0) errMsg += "La distance mini doit être supérieur à 0<BR>"; if (isNaN (t.opt.maxDistance) ||t.opt.maxDistance<1) errMsg += "La distance maxi doit être supérieur à 1<BR>"; if (t.opt.maxDistance<=t.opt.maxDistanceA) errMsg += "La distance max doit être supérieur à la distance mini<BR>"; if(t.opt.maxDistanceA > 375) errMsg += "La distance max ne peut dépasser 375 ! au risque de pêter votre navigateur<BR>"; if (errMsg != ''){ document.getElementById('srcResults').innerHTML = '<FONT COLOR=#660000>ERREUR :</font><BR><BR>'+ errMsg; return; } t.searchRunning = true; document.getElementById ('srcStart').value = 'Stopper la recherche'; m = '<DIV class=ptstat><TABLE width=100% cellspacing=0><TR><TD class=xtab width=125><DIV id=statSearched></div></td>\ <TD class=xtab align=center><SPAN id=statStatus></span></td>\ <TD class=xtab align=right width=125><DIV id=statFound></div></td></tr></table></div>\ <TABLE width=100%><TR valign=top><TD><DIV id=divOutTab style="height:470px; max-height:470px; overflow-y:auto; width:420px;"></div></td>\ <TD id="tddivOutOpts" width=100% height=100% style="background:#e0e0f0; height:100%; padding:5px"><DIV id=divOutOpts></div></td></tr><tr><td colspan=2><div id=BOdivKOCAttackExport style="position:absolute;background-color:white;height:470px; max-height:470px; overflow-y:auto; width:600px;display:none"></div></td><input type=checkbox id=ShowHideOpts>Voir/Cacher les options (permets d\'avoir le plein écran)</tr></table>'; document.getElementById('srcResults').innerHTML = m; // document.getElementById('ShowHideOpts').addEventListener ('click', function (){ if (document.getElementById("ShowHideOpts").checked) { document.getElementById("tddivOutOpts").style.display="none"; document.getElementById("divOutTab").style.width="710px"; } else { document.getElementById("tddivOutOpts").style.display="block"; document.getElementById("divOutTab").style.width="420px"; } }, false); if (t.opt.searchType == 0) typeName = 'Camps Barbares'; else if (t.opt.searchType == 1) typeName = 'Terres Sauvages'; else typeName = 'Villes'; m = '<CENTER><B>Recherche de '+ typeName +'<BR>\ Centre : '+ t.opt.startX +','+ t.opt.startY +' Distance : '+ t.opt.maxDistanceA +' à '+ t.opt.maxDistance +'<BR></center>\ <DIV class=ptentry><TABLE cellspacing=0 width=100%><TR align=center><TD class=xtab colspan=10><B>OPTIONS :</b><BR></td></tr>'; if (t.opt.searchType == 1 || t.opt.searchType == 0) { m += '<TR><TD class=xtab align=right>Niveau Min. :</td><TD class=xtab> <INPUT id=filMinLvl size=2 value='+ Options.srcMinLevel +' /></td></tr>\ <TR><TD class=xtab align=right>Niveau Max. :</td><TD class=xtab> <INPUT id=filMaxLvl size=2 value='+ Options.srcMaxLevel +' /></td></tr>'; } if (t.opt.searchType == 1){ m += '<TR><TD class=xtab align=right>Type TS :</td><TD class=xtab align=right>\ Woodlands<INPUT id=woodWild type=CHECKBOX'+ (Options.woodWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD class=xtab align=right>Prairie/Lac<INPUT id=foodWild type=CHECKBOX '+ (Options.foodWild?' CHECKED':'') +'></td>\ <TD class=xtab align=right>Montagne<INPUT id=mtnWild type=CHECKBOX '+ (Options.mtnWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD class=xtab align=right>Plaine<INPUT id=plnWild type=CHECKBOX '+ (Options.plnWild?' CHECKED':'') +'></td>\ <TD class=xtab align=right>Collines<INPUT id=hillWild type=CHECKBOX'+ (Options.hillWild?' CHECKED':'') +'></td></tr>'; m += '<TR><TD class=xtab align=right>Libre Seulement :</td><TD class=xtab><INPUT id=filUnowned type=CHECKBOX '+ (Options.unownedOnly?' CHECKED':'') +'\><td></tr>'; } if (t.opt.searchType == 1 || t.opt.searchType == 0) { m+= '<TR><TD class=xtab align=right>Trier Par :</td><TD class=xtab><SELECT id=filSortBy>\ <OPTION value="level" '+ (Options.srcSortBy=='level'?'SELECTED':'') +'>Niveau</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>'; if (t.opt.searchType == 1) { m+= '<OPTION value="play" '+ (Options.srcSortBy=='play'?'SELECTED':'') +'>Joueur</option>'; m+= '<OPTION value="alli" '+ (Options.srcSortBy=='alli'?'SELECTED':'') +'>Alliance</option>'; } m+= '</select></td></tr>\ <TR><TD class=xtab align=right>Coords :</td><TD class=xtab><INPUT type=checkbox id=coordsOnly \></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span><DIV id=BOpbSrcExp></div>'; } else { m+= '<TR><TD class=xtab align=right >Voir :</td><TD class=xtab align=left ><SELECT style="width: 135px" id=idSrchFilter>\ <OPTION value=0>Toutes les villes</option>\ <OPTION value=1>Hostile Seulement</option>\ <OPTION value=2>Sous la brume Seulement</option>\ <OPTION value=3>Allie Seulement</option>\ <OPTION value=4>Amis Seulement</option>\ <OPTION value=5>Neutre Seulement</option>\ <OPTION value=6>Sans alliance Seulement </option>\ </select></td></tr>'; m+= '<TR><TD class=xtab align=right>Trier Par :</td><TD class=xtab><SELECT id=filSortBy>\ <OPTION value="might" '+ (Options.srcSortBy=='might'?'SELECTED':'') +'>Puissance</option>\ <OPTION value="dist" '+ (Options.srcSortBy=='dist'?'SELECTED':'') +'>Distance</option>\ <OPTION value="play" '+ (Options.srcSortBy=='play'?'SELECTED':'') +'>Joueur</option>\ <OPTION value="alli" '+ (Options.srcSortBy=='alli'?'SELECTED':'') +'>Alliance</option>\ </select></td></tr>\ <tr><TD class=xtab align=right>Puissance mini :</td><TD class=xtab><select id=filPuissance>\ <option value="0" '+ (Options.filPuissance=='0'?'SELECTED':'') +'>0</option>\ <option value="500" '+ (Options.filPuissance=='500'?'SELECTED':'') +'>500</option>\ <option value="2500" '+ (Options.filPuissance=='2500'?'SELECTED':'') +'>2 500</option>\ <option value="10000" '+ (Options.filPuissance=='10000'?'SELECTED':'') +'>10 000</option>\ <option value="50000" '+ (Options.filPuissance=='50000'?'SELECTED':'') +'>50 000</option>\ <option value="100000" '+ (Options.filPuissance=='100000'?'SELECTED':'') +'>100 000</option>\ <option value="500000" '+ (Options.filPuissance=='500000'?'SELECTED':'') +'>500 000</option>\ <option value="1000000" '+ (Options.filPuissance=='1000000'?'SELECTED':'') +'>1 000 000</option>\ </select></td></tr>\ <tr><TD class=xtab align=right>Puissance max :</td><TD class=xtab><select id=filPuissanceMax>\ <option value="500" '+ (Options.filPuissanceMax=='500'?'SELECTED':'') +'>500</option>\ <option value="2500" '+ (Options.filPuissanceMax=='2500'?'SELECTED':'') +'>2 500</option>\ <option value="10000" '+ (Options.filPuissanceMax=='10000'?'SELECTED':'') +'>10 000</option>\ <option value="50000" '+ (Options.filPuissanceMax=='50000'?'SELECTED':'') +'>50 000</option>\ <option value="100000" '+ (Options.filPuissanceMax=='100000'?'SELECTED':'') +'>100 000</option>\ <option value="500000" '+ (Options.filPuissanceMax=='100000'?'SELECTED':'') +'>500 000</option>\ <option value="1000000" '+ (Options.filPuissanceMax=='1000000'?'SELECTED':'') +'>1 000 000</option>\ <option value="100000000" '+ (Options.filPuissanceMax=='100000000'?'SELECTED':'') +'>100 millions</option>\ </select></td></tr>\ <TR><TD class=xtab align=right>Coords :</td><TD class=xtab><INPUT type=checkbox id=coordsOnly \></td></tr>\ </table></div><BR><SPAN id=srchSizeWarn></span>'; } document.getElementById('divOutOpts').innerHTML = m; if (t.opt.searchType == 1 || t.opt.searchType == 0) { document.getElementById('filMinLvl').addEventListener ('change', function (){ Options.srcMinLevel = document.getElementById('filMinLvl').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filMaxLvl').addEventListener ('change', function (){ Options.srcMaxLevel = document.getElementById('filMaxLvl').value; saveOptions(); t.dispMapTable (); }, false); } document.getElementById('filSortBy').addEventListener ('change', function (){ Options.srcSortBy = document.getElementById('filSortBy').value; saveOptions(); t.dispMapTable (); }, false); document.getElementById('coordsOnly').addEventListener ('change', function (){ t.dispMapTable (); }, false); if (t.opt.searchType == 1){ document.getElementById('foodWild').addEventListener ('change', function(){ Options.foodWild = document.getElementById('foodWild').checked; saveOptions(); t.dispMapTable (); }, false); document.getElementById('hillWild').addEventListener ('change', function(){ Options.hillWild = document.getElementById('hillWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('mtnWild').addEventListener ('change', function(){ Options.mtnWild = document.getElementById('mtnWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('plnWild').addEventListener ('change', function(){ Options.plnWild = document.getElementById('plnWild').checked; saveOptions(); t.dispMapTable(); }, false); document.getElementById('woodWild').addEventListener ('change', function(){ Options.woodWild = document.getElementById('woodWild').checked; saveOptions(); t.dispMapTable (); }, false); document.getElementById('filUnowned').addEventListener ('change', function (){ Options.unownedOnly = (document.getElementById('filUnowned').checked); saveOptions(); t.dispMapTable (); }, false); } if (t.opt.searchType == 2){ document.getElementById('idSrchFilter').addEventListener ('change', function (){ Options.citySrchFilter = (document.getElementById('idSrchFilter').value); saveOptions(); t.dispMapTable (); }, false); document.getElementById('idSrchFilter').value = Options.citySrchFilter; document.getElementById('filPuissance').addEventListener ('change', function (){ Options.filPuissance = parseInt(document.getElementById('filPuissance').value); saveOptions(); t.dispMapTable (); }, false); document.getElementById('filPuissanceMax').addEventListener ('change', function (){ Options.filPuissanceMax = parseInt(document.getElementById('filPuissanceMax').value); saveOptions(); t.dispMapTable (); }, false); } t.mapDat = []; t.firstX = t.opt.startX - t.opt.maxDistance; t.lastX = t.opt.startX + t.opt.maxDistance; t.firstY = t.opt.startY - t.opt.maxDistance; t.lastY = t.opt.startY + t.opt.maxDistance; t.tilesSearched = 0; t.tilesFound = 0; t.curX = t.firstX; t.curY = t.firstY; var xxx = t.normalizeCoord(t.curX); var yyy = t.normalizeCoord(t.curY); document.getElementById ('statStatus').innerHTML = 'Recherche sur '+ xxx +','+ yyy; if (DEBUG_TRACE) logit (" 0 clickedSearch()... setTimeout ..:" + xxx +' , '+ yyy +' , '+ t.mapCallback.name); setTimeout (function(){Map.request (xxx, yyy, 15, t.mapCallback)}, MAP_DELAY); }, dispMapTable : function (){ var tileNames = ['Camps barbares', 'Prairie', 'Lac', 'Bois', 'Collines', 'Montagne', 'Plaine', 'Ville' ]; var t = my.Search; var coordsOnly = document.getElementById('coordsOnly').checked; if (DEBUG_TRACE) DebugTimer.start(); function mySort(a, b){ if (Options.srcSortBy == 'level'){ if ((x = a[4] - b[4]) != 0) return x; } if (Options.srcSortBy == 'might'){ if ((x = b[10] - a[10]) != 0) return x; } if (Options.srcSortBy == 'alli'){ if (a[11] < b[11]) return -1; else if (a[11] == b[11]) return 0; else return 1; } if (Options.srcSortBy == 'play'){ if (a[9] < b[9]) return -1; else if (a[9] == b[9]) return 0; else return 1; } return a[2] - b[2]; } dat = []; for (i=0; i<t.mapDat.length; i++){ lvl = parseInt (t.mapDat[i][4]); type = t.mapDat[i][3]; puissance = t.mapDat[i][10]; if (t.opt.searchType == 2 && type == 7 ) { switch(parseInt (Options.citySrchFilter)) { case 0: if (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax) { dat.push(t.mapDat[i]); } break; case 1: if ((t.mapDat[i][12] == 'Hostile') && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; case 2: if ((t.mapDat[i][5]===true) && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; case 3: if ((t.mapDat[i][12] == 'Ally') && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; case 4: if ((t.mapDat[i][12] == 'Friendly') && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; case 5: if ((t.mapDat[i][12] == 'Neutral') && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; case 6: if ((t.mapDat[i][12] == 'unaligned') && (Options.filPuissance<=puissance && puissance<=Options.filPuissanceMax)) { dat.push(t.mapDat[i]); } break; } } else { if (lvl>=Options.srcMinLevel && lvl<=Options.srcMaxLevel){ if (t.opt.searchType==0 || (Options.woodWild==1 && type == 3) || (Options.hillWild==1 && type ==4) || (Options.mtnWild==1 && type==5) || (Options.plnWild==1 && type == 6) || (Options.foodWild==1 && (type==1 || type==2))) if (!Options.unownedOnly || t.mapDat[i][5]===false) dat.push (t.mapDat[i]); } } } document.getElementById('statFound').innerHTML = 'Trouvé : '+ dat.length; if (dat.length == 0){ m = '<BR><CENTER>Non trouvé</center>'; } else { dat.sort(mySort); if (DEBUG_TRACE) DebugTimer.display('SEACHdraw: SORT'); if (coordsOnly) m = '<TABLE align=center id=srcOutTab cellpadding=0 cellspacing=0><TR style="font-weight: bold"><TD>Location</td></tr>'; else { if (t.opt.searchType == 0) { m = '<TABLE id=srcOutTab cellpadding=0 cellspacing=0><TR style="font-weight: bold"><TD>Lieu</td><TD style="padding-left: 10px">Dist</td><TD style="padding-left: 10px;">Niv</td><TD style="padding-left: 10px;">Type</td></tr>'; } if (t.opt.searchType == 1) { m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Lieu</td><TD style="padding-left: 10px">Dist</td><TD style="padding-left: 10px;">Niv</td><TD style="padding-left: 10px;">Type</td><TD style="padding-left: 10px;">Joueur</td><td style="padding-left: 10px;">Puissance</td><td style="padding-left: 10px;">Alliance</td><td>Statut</td><td>Connexion</td></tr>'; } if (t.opt.searchType == 2) { m = '<TABLE id=srcOutTab cellpadding=2 cellspacing=2><TR style="font-weight: bold"><TD>Loc</td><TD >Dist</td><TD>Ville</td><TD>Proprio</td><TD>Puis.</td><td>Alliance </td><TD width=80% style="font-size:9px;">Plus info</td></tr>'; } } var numRows = dat.length; if (numRows > 500 && t.searchRunning){ numRows = 500; document.getElementById('srchSizeWarn').innerHTML = '<FONT COLOR=#600000>NOTE : Le tableau montre seulement 500 des '+ dat.length +' resultats jusqu\'a ce que la recherche soit terminée.</font>'; } for (i=0; i<numRows; i++){ m += '<TR valign="top"'; if (dat[i][12]) m += 'class="'+dat[i][12]+'"'; if (coordsOnly) { m += ' ><TD valign="top"><DIV>'+ dat[i][0] +','+ dat[i][1] +'</div></td></tr>'; } else { m += ' ><TD valign="top"><DIV>\ <a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+ dat[i][0] +','+ dat[i][1] +')</a></div></td>'; if (t.opt.searchType == 2) { m += '<TD align="left" valign="top"><DIV onclick="PTscout('+ dat[i][0] +','+ dat[i][1] +');return false;"><img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg" title="Eclaireur !"> '+ dat[i][2].toFixed(2) +'</a></td><TD align=left>'+ dat[i][8] +'</td><TD valign="top">'+dat[i][9]+'</td><TD valign="top">'+addCommasInt(dat[i][10])+'</td><td>'+dat[i][11]+'</td><td>'; if (dat[i][5]) { m += '<DIV onclick="BoPTscout('+ dat[i][0] +','+ dat[i][1] +');return false;"><A style="font-size:9px;" >Eclairer</a></div>'; } else { m += '<DIV onclick="BoPTpd(this, '+ dat[i][7] +')"><A style="font-size:9px;" >Details</a></div> <DIV style="" onclick="BoPTpd2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Tableau Honneur</a></div>\ <DIV style="" onclick="BoPCpo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Statut</a></div>\ <DIV style="" onclick="BoPCplo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Dernière Connexion</a></div>'; m+= '</td></tr>'; } } else { m += '<TD align=right valign="top">'+ dat[i][2].toFixed(2) +' </td><TD align=right>'+ dat[i][4] +'</td><TD> '+ tileNames[dat[i][3]]; +'</td>'; if (t.opt.searchType == 1) { if (dat[i][5]) { m += '<td>'+dat[i][9]+'<td>'+addCommasInt(dat[i][10])+'</td><td>'+dat[i][11]+'</td>'; if (dat[i][7] && dat[i][7]!=0) { m+='<td><DIV style="" onclick="BoPCpo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Statut</a></div></td><td><DIV style="" onclick="BoPCplo2(this, '+ dat[i][7] +')"><A style="font-size:9px;">Dernière Connexion</a></div></td>'; } else { m+='<td> </td><td> </td>'; } } else { m +='<td colspan=5 style="text-align=center"><i><b>libre...</b></i>'; } }else{ m+="<td></td>"; } m +='</tr>'; } } } m += '</table>'; } document.getElementById('divOutTab').innerHTML = m; dat = null; }, mapDat : [], stopSearch : function (msg){ var t = my.Search; document.getElementById ('statStatus').innerHTML = '<FONT color=#ffaaaa>'+ msg +'</font>'; document.getElementById ('srcStart').value = 'Lancer la recherche'; document.getElementById('srchSizeWarn').innerHTML = ''; if (t.opt.searchType==0){ document.getElementById('BOpbSrcExp').innerHTML = '<CENTER>'+ strButton20('Exporter le résultat', 'id=BOpbSrcDoExp') +'</center>'; document.getElementById ('BOpbSrcDoExp').addEventListener ('click', t.exportKOCattack, false); } t.searchRunning = false; }, clickedPlayerCheckOnline : function (span, uid){ var t = my.AllianceList; var s = my.Search; span.onclick = ''; span.innerHTML = "recherche en cours..."; t.fetchPlayerStatusSimple (uid, function (r) {s.gotPlayerStatus(r, span, uid)}); }, clickedPlayerGetLastLogin : function (span, uid){ var t = my.AllianceList; var s = my.Search; span.onclick = ''; span.innerHTML = "recherche en cours ..."; t.fetchPlayerLastLogin (uid, function (r) {s.gotPlayerLastLogin(r, span)}); }, gotPlayerStatus : function (rslt, span,uid){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.data; if (p[uid] == true) { m = '<span style="color:green"><b>En Ligne!</b></span>'; } else { m = '<span style="color:red"><b>Pas en ligne</b></span>'; } span.innerHTML = m + ''; }, gotPlayerLastLogin : function (rslt, span){ var t = my.AllianceList; if (!rslt.ok){ span.innerHTML = rslt.errorMsg; return; } var p = rslt.playerInfo; var lastLogin = rslt.playerInfo.lastLogin; if (lastLogin) { m = '<span style="color:black">'+lastLogin+'</span>'; } else { m = '<span style="color:red">?</span>'; } span.innerHTML = m + ''; }, exportKOCattack : function (){ var t = my.Search; var bulkAdds = {}; for (i=1; i<11; i++) bulkAdds['lvl'+ i] = []; for (i=0; i<t.mapDat.length; i++){ var lvl = parseInt (t.mapDat[i][4]); if (lvl>=Options.srcMinLevel && lvl<=Options.srcMaxLevel && t.mapDat[i][3]==0) bulkAdds['lvl'+ lvl].push({x:t.mapDat[i][0], y:t.mapDat[i][1]}); } exportToKOCattackBO.doExport (bulkAdds, t.selectedCity); }, mapCallback : function (left, top, width, rslt){ function insertRow (x, y, msg){ row = document.getElementById('srcOutTab').insertRow(-1); row.insertCell(0).innerHTML = x +','+ y; row.insertCell(1).innerHTML = distance (t.opt.startX, t.opt.startY, x, y); row.insertCell(2).innerHTML = msg; } if (DEBUG_TRACE) logit (" 3 mapCallback()"); var t = my.Search; if (!t.searchRunning) return; if (!rslt.ok){ t.stopSearch ('ERREUR : '+ rslt.errorMsg); return; } map = rslt.data; var userInfo = rslt.userInfo; var alliance = rslt.allianceNames; for (k in map){ if (t.opt.searchType==0 && map[k].tileType==51 && !map[k].tileCityId ) { // if barb type = 0; } else if (t.opt.searchType==1 && map[k].tileType>=10 && map[k].tileType<=50) { if (map[k].tileType == 10) type = 1; else if (map[k].tileType == 11) type = 2; else type = (map[k].tileType/10) + 1; } else if (t.opt.searchType==2 && map[k].tileCityId >= 0 && map[k].tileType > 50 && map[k].cityName) { type = 7; } else { continue; } dist = distance (t.opt.startX, t.opt.startY, map[k].xCoord, map[k].yCoord); if (dist <= t.opt.maxDistance && dist >= t.opt.maxDistanceA){ if (t.opt.searchType==2) { var isMisted = map[k].tileUserId == 0 || false; var uu = 'u'+map[k].tileUserId; var aU = 'inconnu'; var aD = 'inconnu'; var mightU = 0; var nameU = 'inconnu'; if (isMisted) { nameU = 'Brume'; mightU = 0; } else { if (userInfo[uu] ) { // Corrects a problem with hung search. nameU = "<a onclick=getInfoForAnUser('"+ map[k].tileUserId +"');>"+ userInfo[uu].n +"</a>"; mightU = userInfo[uu].m; aD = getDiplomacy2(userInfo[uu].a); if ( alliance && alliance['a'+userInfo[uu].a] ) { aU = alliance['a'+userInfo[uu].a]; } else { aU = '----'; aD = 'unaligned'; } } } t.mapDat.push ([map[k].xCoord, map[k].yCoord, dist, type, map[k].tileLevel, isMisted, map[k].tileCityId, map[k].tileUserId, map[k].cityName,nameU,mightU,aU,aD ]); } else { isOwned = map[k].tileUserId>0 || map[k].misted; var uu = 'u'+map[k].tileUserId; var aU = 'inconnu'; var aD = 'inconnu'; var nameU = 'inconnu'; var mightU = 0; if (map[k].misted) { nameU = 'Sous la Brume'; }else { if (userInfo[uu] ) { var nameU = "<a onclick=getInfoForAnUser('"+ map[k].tileUserId +"');>"+ userInfo[uu].n +"</a>"; mightU = userInfo[uu].m; aD = getDiplomacy2(userInfo[uu].a); if ( alliance && alliance['a'+userInfo[uu].a] ) { aU = alliance['a'+userInfo[uu].a]; } }else { var nameU = 'inconnu'; } } t.mapDat.push ([map[k].xCoord, map[k].yCoord, dist, type, map[k].tileLevel, isOwned, map[k].tileCityId, map[k].tileUserId, map[k].cityName, nameU, mightU, aU, aD]); } ++t.tilesFound; } } t.tilesSearched += (15*15); document.getElementById('statSearched').innerHTML = 'Trouvé : '+ t.tilesSearched; t.dispMapTable(); t.curX += 15; if (t.curX > t.lastX){ t.curX = t.firstX; t.curY += 15; if (t.curY > t.lastY){ t.stopSearch ('Fini !'); return; } } var x = t.normalizeCoord(t.curX); var y = t.normalizeCoord(t.curY); document.getElementById ('statStatus').innerHTML = 'Recherche sur '+ x +','+ y; //if (DEBUG_TRACE) logit (" 0 mapCallback()... setTimeout ..:" + x +' , '+ y +' , '+ t.mapCallback.toString().substr (0,50)); setTimeout (function(){Map.request (x, y, 15, t.mapCallback)}, MAP_DELAY); }, }; /******************* KOC Map interface ****************/ Map = { /*** 0: bog 10: grassland 11: lake 20: woods 30: hills 40: mountain 50: plain 51: city / barb 53: misted city ***/ generateBlockList : function(left, top, width) { var width5 = parseInt(width / 5); var bl = []; for (x=0; x<width5; x++){ xx = left + (x*5); if (xx > 745) xx -= 750; for (y=0; y<width5; y++){ yy = top + (y*5); if (yy > 745) yy -= 750; bl.push ('bl_'+ xx +'_bt_'+ yy); } } return bl.join(","); }, callback : null, request : function (left, top, width, cb) { if (DEBUG_TRACE) logit (" 1 Map.request(): "+ left +' , '+ top +' , '+ width); left = parseInt(left / 5) * 5; top = parseInt(top / 5) * 5; width = parseInt((width+4) / 5) * 5; var blockString = this.generateBlockList(left, top, width); Map.callback = cb; if (unsafeWindow.SANDBOX) return RequestMAPTEST(left, top, width, callback); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.blocks = blockString; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchMapTiles.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (DEBUG_TRACE) logit (" 2 Map.request Map = "+ inspect (Map, 2, 1, 2)); Map.callback(left, top, width, rslt); }, onFailure: function (rslt) { Map.callback(left, top, width, rslt); } }); }, }; /******** Export to KOC Attack **********/ var exportToKOCattackBO = { troops : {}, init : function (){ var t = exportToKOCattackBO; for (var b=1; b<11; b++){ t.troops['b'+ b] = []; for (var trp=0; trp<12; trp++){ t.troops['b'+ b][trp] = 0; } } var s = GM_getValue ('atkTroops_'+ getServerId(), null); if (s != '' && s!=null){ var trp = JSON2.parse(s); // alert('4'); for (var b=1; b<11; b++){ if (trp['b'+ b] && trp['b'+ b].length == 12) t.troops['b'+ b] = trp['b'+ b]; } } window.addEventListener('unload', t.onUnload, false); }, onUnload : function (){ var t = exportToKOCattackBO; GM_setValue ('atkTroops_'+ getServerId(), JSON2.stringify(t.troops)); }, doExport : function (coordList, city){ var t = exportToKOCattackBO; var popExp = null; var cList = coordList; var curLevel = 0; var city = city; var troopDef = [ ['Ravil', 1], ['Wagon', 9], ['Archers', 6], ['Cavalerie', 7], ['Lourds', 8], ['Baliste', 10], ]; var divKOCAttackExport=document.getElementById('BOdivKOCAttackExport'); divKOCAttackExport.style.display='block'; divKOCAttackExport.style.border='1px solid #000'; divKOCAttackExport.style.top='100px'; divKOCAttackExport.style.left='50px'; var m = '<DIV id=BOdragExport class=ptstat><table width="100%" cellspacing="0" border=0><tr><td class=ptstat>Exporter les barbares directement dans KOC Attack</td><td id="idp_ExportX" onmouseover="this.style.cursor=\'pointer\'" style="color: rgb(255, 255, 255); background: none repeat scroll 0% 0% rgb(85, 85, 85); padding-left: 5px; padding-right: 5px; cursor: pointer;" valign="middle" align="right">X</td></tr></table></div><BR><TABLE align=center cellpadding=0 cellspacing=0 class=pbTabPadNW>\ <TR style="font-weight:bold; background-color:white"><TD>Type cible</td><TD style="padding:1px" align=center>#<BR>cibles</td><TD width=17></td>'; for (var i=0; i<troopDef.length; i++) m += '<TD>'+ troopDef[i][0] +'</td>'; m += '</tr>'; for (var b=1; b<11; b++){ m += '<TR><TD>Barb niv '+ b +'</td><TD align=right>'+ coordList['lvl'+b].length +' </td><TD></td>'; for (var td=0; td<troopDef.length; td++) m += '<TD><INPUT id=ptET_'+ b +'_'+ troopDef[td][1] +' type=text size=4 value="'+ t.troops['b'+ b][troopDef[td][1]-1] +'"></td>'; m += '<TD width=90%><SPAN class=boldRed id=ptETerr_'+ b +'></span></tr>'; } m += '</table>'; var isKOCattack = !(document.getElementById('KOCAttackToggle') == null); //TODO: 'RESET VALUES' button ? if (isKOCattack){ m += '<BR><CENTER>'+ strButton20('Ajouter les coordonnées dans KOC Attack', 'id=pbSrcDoBA') +'</center>'; } else { m += 'KOC Attack n\'est pas lancé, impossible d\'exporter'; } m += '<CENTER><DIV style="width:70%" id=pbSrcExpResult></DIV></center>'; divKOCAttackExport.innerHTML = m; new CWinDrag (document.getElementById('BOdragExport'), divKOCAttackExport, true); document.getElementById('idp_ExportX').addEventListener ('click', function() { document.getElementById('BOdivKOCAttackExport').style.display="none"; document.getElementById('BOdivKOCAttackExport').innerHTML = ""; }, false); for (var b=1; b<11; b++) for (var td=0; td<troopDef.length; td++) document.getElementById('ptET_'+ b +'_'+ troopDef[td][1]).addEventListener ('change', validate, false); //divKOCAttackExport.innerHTML = '<CENTER><B>Exportation Boite a Outils</b></center>'; if (isKOCattack) document.getElementById ('pbSrcDoBA').addEventListener ('click', doBulkAdd, false); //popExp.show(true); if (city != null){ for (var i=0; i<Cities.numCities; i++) if (city.id == Cities.cities[i].id) break; if (i < Cities.numCities){ setTimeout (function(){unsafeWindow.citysel_click(document.getElementById('citysel_'+ (i+1)));}, 0); //logit ("SWITCH CITY: "+ (i+1)); } } // TODO: WAIT FOR City select ? function validate (e){ var x = e.target.id.substr(5).split('_'); var b = x[0]; var trp = x[1]; document.getElementById('ptETerr_'+ b).innerHTML = ''; var x = parseIntZero (e.target.value); if (isNaN(x) || x<0 || x>100000){ e.target.style.backgroundColor = 'red'; document.getElementById('ptETerr_'+ b).innerHTML = 'Entrée invalide'; return; } else { e.target.style.backgroundColor = ''; e.target.value = x; t.troops['b'+ b][trp-1] = x; } var tot = 0; for (var td=0; td<troopDef.length; td++) tot += parseIntZero(document.getElementById('ptET_'+ b +'_'+ [troopDef[td][1]]).value); if (tot<1 && cList['lvl'+ b].length>0 ) document.getElementById('ptETerr_'+ b).innerHTML = 'No troops defined'; if (tot>100000) document.getElementById('ptETerr_'+ b).innerHTML = 'Trop de troupes'; } function doBulkAdd (){ for (var b=1; b<11; b++){ if (document.getElementById('ptETerr_'+ b).innerHTML != '') return; var tot = 0; for (var td=0; td<troopDef.length; td++) tot += t.troops['b'+b][troopDef[td][1]-1]; if (tot<1 && cList['lvl'+ b].length>0){ document.getElementById('ptETerr_'+ b).innerHTML = 'No troops defined'; return; } else if (tot>100000) { document.getElementById('ptETerr_'+ b).innerHTML = 'Trop de troupes'; return; } } document.getElementById('pbSrcExpResult').innerHTML = ''; setTimeout(function() { doNextLevel (); }, 100); } function endBulkAdd (msg){ unsafeWindow.Modal.hideModalAll(); curLevel = 0; document.getElementById('pbSrcExpResult').innerHTML += msg; } function doNextLevel (){ while ( curLevel<10 && cList['lvl'+ ++curLevel].length==0) ; if (curLevel>=10){ unsafeWindow.Modal.hideModalAll(); curLevel = 0; document.getElementById('pbSrcExpResult').innerHTML += "Fini !"; //setTimeout(function() { divKOCAttackExport.innerHTML=""; }, 1000); return; } setTimeout(function() { unsafeWindow.Modal.hideModalAll(); unsafeWindow.modal_attack(4,0,0); new CwaitForElement ('BulkAddAttackDiv', 5000, e_attackDialog ); }, 250); } function e_attackDialog (tf){ if (!tf){ endBulkAdd ('<SPAN class=boldRed>ERREUR: impossible d\'ouvrir la page attaque</span>'); return; } var div = searchDOM (document.getElementById('BulkAddAttackDiv'), 'node.tagName=="DIV" && node.style.display=="none"', 10); if (div==null){ endBulkAdd ('<SPAN class=boldRed>ERREUR: Unexpected attack dialog format (1).</span>'); return; } var ta = searchDOM (div, 'node.tagName=="TEXTAREA"', 10); var but = searchDOM (div, 'node.tagName=="A"', 10); if (ta==null || but==null){ endBulkAdd ('<SPAN class=boldRed>ERREUR: Unexpected attack dialog format (2).</span>'); return; } for (var trp=1; trp<13; trp++){ var inp = document.getElementById('modal_attack_unit_ipt' +trp); inp.value = t.troops['b'+curLevel][trp-1]; if (t.troops['b'+curLevel][trp-1] > 0) inp.style.backgroundColor = 'yellow'; else inp.style.backgroundColor = 'white'; } div.style.display = 'block'; document.getElementById('KOCAttackBulkAddForce').checked = true; var m = ''; var list = cList['lvl'+ (curLevel)]; for (i=0; i<list.length; i++) m += list[i].x +','+ list[i].y +'\n'; ta.value = m; clickWinBO(unsafeWindow, but, 'click'); unsafeWindow.Modal.hideModal(); //alert('ici'); //document.getElementById('pbSrcExpResult').innerHTML += 'Ajout de '+ list.length +' coordonnees sur '+ city.name +'<BR>'; //alert('la'); setTimeout (doNextLevel, 500); } }, } function clickWinBO(win,obj,evtName) { var evt = win.document.createEvent("MouseEvents"); evt.initMouseEvent(evtName, true, true, win, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return !obj.dispatchEvent(evt); } function searchDOM (node, condition, maxLevel, doMult){ var found = []; eval ('var compFunc = function (node) { return ('+ condition +') }'); doOne(node, 1); if(!doMult){ if (found.length==0) return null; return found[0]; } return found; function doOne (node, curLevel){ try { if (compFunc(node)) found.push(node); } catch (e){ } if (!doMult && found.length>0) return; if (++curLevel<maxLevel && node.childNodes!=undefined) for (var c=0; c<node.childNodes.length; c++) doOne (node.childNodes[c], curLevel); } } function CwaitForElement (id, timeout, notify){ this.check = check; this.end = new Date().getTime() + timeout; var t = this; this.check(); function check(){ if (document.getElementById (id)) notify (true); else if (new Date().getTime() > t.end) notify (false); else setTimeout (t.check, 250); } } /*************************************** Train Tab ***********************************************/ my.Train = { cont : null, timer : null, state : null, stats : {}, selectedCity : {}, sourceCity : {}, destinationCity : {}, init : function (){ var t = my.Train; t.cont = document.createElement('div'); return t.cont; }, getContent : function (){ var t = my.Train; return t.cont; }, hide : function (){ var t = my.Train; clearTimeout (t.timer); }, show : function (){ var t = my.Train; unsafeWindow.BOcancelTraining = t.cancelTrainingBO; unsafeWindow.BOcancelFort = t.butcancelFort; clearTimeout (t.timer); if (t.state == null){ s = "<DIV id=trainTopSelect >\ <DIV class=ptstat>Former des troupes et construire des défenses sur les remparts</div><DIV style='height:10px'></div><DIV class=ptentry>\ <DIV style='text-align:center; margin-bottom:10px;'>Ville : <span id=ptspeedcity></span></div>\ <TABLE class=ptTab width=100%><TR valign=top><TD width=50%>\ <TABLE align=center><TR><TD align=right>Type de troupe : </td><TD colspan=2>\ <SELECT id=ptttType>"; for (r=1; r<13; r++){ if (r==2) { s+= "<option selected value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } else { s+= "<option value='"+r+"'>"+unsafeWindow.unitcost['unt'+r][0]+"</option>"; } } if (Seed.items.i36){tutel1=Seed.items.i36}else{tutel1=0}; if (Seed.items.i37){tutel2=Seed.items.i37}else{tutel2=0}; if (Seed.items.i38){tutel3=Seed.items.i38}else{tutel3=0}; if (Seed.items.i26){siege1=Seed.items.i26}else{siege1=0}; s+= " </select> <br> (max <span id=ptttSpMax></span>)</td></tr>\ <TR><TD align=right>par slot de </td><TD><INPUT id='ptttInpPS' size=5 type='text' value='0'\></td>\ <TD><INPUT id='ptttButMaxPS' type=submit value='max'\> (max <span id=ptttSpMaxPS>0</span>)</td></tr>\ <TR><TD align=right>sur</td><TD><INPUT id='ptttInpSlots' size=2 type='text' value='1'\> slots</td>\ <TD width=75%><INPUT id='ptttButMaxSlots' type=submit value='max'\> (max <span id=ptttSpMaxSlots>1</span>)</td></tr>\ <TR><TD align=right valign=top>Utiliser la force de travail : </td><TD colspan=2><INPUT type=CHECKBOX id=chkPop"+ (Options.maxIdlePop?' CHECKED ':'') +">\ - Réduction : <SELECT id=BOGamble>\ <option value='0'>Normal</option>\ <option value='1'>5% - 15%</option>\ <option value='2'>10% - 25%</option>\ </select>\ <br><SELECT id=tutelage>\ <option value='0'><CENTER>--- "+unsafeWindow.g_js_strings.commonstr.speedup+" ---</center></option>\ <option value='36'>"+ unsafeWindow.itemlist.i36.name+" ("+tutel1+")</option>\ <option value='37'>"+ unsafeWindow.itemlist.i37.name+" ("+tutel2+")</option>\ <option value='38'>"+ unsafeWindow.itemlist.i38.name+" ("+tutel3+")</option>\ </select>\</td></tr>\ <TR><TD colspan=3 align=center><DIV style='height:10px'></div><INPUT id='ptttButDo' type=submit value='"+unsafeWindow.g_js_strings.modal_openBarracks.trainttl+"'\>\ <br><span id='BOmodal_barracks_traintime'>Durée :</span></td></tr>\ </table></td><TD width=20></td><TD style='border-left:solid 2px;' width=50% align=center>\ <TABLE align=center><TR><TD align=right>Type de défenses : </td><TD colspan=2>\ <SELECT id=pttdType>\ <option value='53'>"+unsafeWindow.fortcost.frt53[0]+"</option>\ <option value='55'>"+unsafeWindow.fortcost.frt55[0]+"</option>\ <option value='60'>"+unsafeWindow.fortcost.frt60[0]+"</option>\ <option value='61'>"+unsafeWindow.fortcost.frt61[0]+"</option>\ <option value='62'>"+unsafeWindow.fortcost.frt62[0]+"</option>\ </select> <br> (<span id=pttdSpMax></span>)</td></tr>\ <TR><TD align=right># par slot de </td><TD><INPUT id='pttdInpPS' size=5 type='text' value='0'\></td>\ <TD><INPUT id='pttdButMaxPS' type=submit value='max'\> (max <span id=pttdSpMaxPS>0</span>)</td></tr>\ <TR><TD align=right># sur </td><TD><INPUT id='pttdInpSlots' size=2 type='text' value='1'\> slots</td>\ <TD width=75%><INPUT id='pttdButMaxSlots' type=submit value='max'\> (max <span id=pttdSpMaxSlots>1</span>)</td></tr>\ <TR align=center><TD colspan=3><SPAN id=pttdSpace></span></td></tr>\ <TR><TD colspan=3 align=center><DIV style='height:10px'>\ <SELECT id=siege>\ <option value='0'><CENTER>--- "+unsafeWindow.g_js_strings.commonstr.speedup+" ---</center></option>\ <option value='26'>"+ unsafeWindow.itemlist.i26.name+" ("+siege1+")</option>\ </select></div>\ <BR><INPUT id='pttdButDo' type=submit value='"+unsafeWindow.g_js_strings.modal_openWalls.builddefenses+"'\>\ <br><span id='BOmodal_barracks_deftime'>Durée :</span> </td></tr></table>\ </td></tr></table></div></div>\ <TABLE align=center width=425 class=ptTab><TR><TD><div id=ptTrainStatus style='overflow-y:auto; max-height:70px; height: 70px;'></div></td></tr></table>\ <div style='height: 315px; background: #e8ffe8; max-height:315px; overflow-y:auto'>\ <br><TABLE width=100% class=ptTab><TR><TD colspan=3><DIV id=divSTtop></div></td></tr>\ <TR><TD width=50% style='padding-left:15px; padding-right:15px'><DIV style='text-align:center'><img style='display:block;position:absolute;padding:0;margin:0;' id=BOCancelAllTrain valign=absmiddle border=0 title='Annuler toute les formations' src='http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png'> <B>Les troupes (<SPAN id=statTTtot></span>)</b><BR><HR></div><DIV id=divSTleft style='overflow-y: auto; height:140px; max-height:140px'></div></td>\ <TD width=50% style='padding-left:15px; padding-right:15px'><DIV style='text-align:center'><B>Les défenses (<SPAN id=statDTtot></span>)</b><BR><HR></div><DIV id=divSTright style='overflow-y: auto; height:140px; max-height:140px'></div></td></tr>\ </div></div>"; t.cont.innerHTML = s; var dcp = new CdispCityPicker ('ptspeed', document.getElementById('ptspeedcity'), true, t.clickCitySelect, 0); t.TTspMax = document.getElementById ('ptttSpMax'); t.BOGamble = document.getElementById ('BOGamble'); t.TTspMaxPS = document.getElementById ('ptttSpMaxPS'); t.TTspMaxSlots = document.getElementById ('ptttSpMaxSlots'); t.TTbutMaxSlots = document.getElementById ('ptttButMaxSlots'); t.TTbutMaxPerSlot = document.getElementById ('ptttButMaxPS'); t.TTinpPerSlot = document.getElementById ('ptttInpPS'); t.TTinpSlots = document.getElementById ('ptttInpSlots'); t.TTselType = document.getElementById ('ptttType'); t.TTbutDo = document.getElementById ('ptttButDo'); t.TDspMax = document.getElementById ('pttdSpMax'); t.TDspMaxPS = document.getElementById ('pttdSpMaxPS'); t.TDspMaxSlots = document.getElementById ('pttdSpMaxSlots'); t.TDbutMaxSlots = document.getElementById ('pttdButMaxSlots'); t.TDbutMaxPerSlot = document.getElementById ('pttdButMaxPS'); t.TDinpPerSlot = document.getElementById ('pttdInpPS'); t.TDinpSlots = document.getElementById ('pttdInpSlots'); t.TDselType = document.getElementById ('pttdType'); t.TDbutDo = document.getElementById ('pttdButDo'); t.TDspSpace = document.getElementById ('pttdSpace'); t.divTrainStatus = document.getElementById ('ptTrainStatus'); t.TTinpSlots.addEventListener ('change', t.updateTopTroops, false); t.BOGamble.addEventListener ('change', t.changeTroopSelect, false); t.TTbutMaxPerSlot.addEventListener ('click', t.clickTroopMaxPS, false); t.TTbutMaxSlots.addEventListener ('click', t.clickTroopMaxSlots, false); t.TTselType.addEventListener ('change', t.changeTroopSelect, false); t.TTbutDo.addEventListener ('click', t.clickTroopDo, false); t.TDinpSlots.addEventListener ('change', t.updateTopDef, false); t.TDselType.addEventListener ('change', t.changeDefSelect, false); t.TDbutMaxPerSlot.addEventListener ('click', t.clickDefMaxPS, false); t.TDbutMaxSlots.addEventListener ('click', t.clickDefMaxSlots, false); t.TDbutDo.addEventListener ('click', t.clickDefDo, false); document.getElementById ('BOCancelAllTrain').addEventListener ('click', t.CancelAllTraining, false); document.getElementById ('chkPop').addEventListener ('change', t.clickCheckIdlePop, false); t.changeTroopSelect(); t.changeDefSelect(); t.state = 1; } t.displayCityStats(); t.changeTroopSelect(); t.changeDefSelect(); t.timer = setTimeout (t.show, 2000); }, /******* TROOPS ******/ updateTopTroops : function (){ var t = my.Train; var slots = parseInt(t.TTinpSlots.value, 10); if (isNaN(slots) || slots<0) slots = 0; t.TTspMax.innerHTML = t.stats.MaxTrain; t.TTspMaxSlots.innerHTML = t.stats.barracks - t.stats.queued; if (slots<1 || (t.stats.barracks-t.stats.queued < 1)) t.TTspMaxPS.innerHTML = 0; else t.TTspMaxPS.innerHTML = parseInt(t.stats.MaxTrain / slots); }, clickTroopMaxPS : function (){ var t = my.Train; var slots = parseInt(t.TTinpSlots.value, 10); if (slots<1 || (t.stats.barracks-t.stats.queued < 1)) t.TTinpPerSlot.value = 0; else t.TTinpPerSlot.value = parseInt(t.stats.MaxTrain / slots); }, clickTroopMaxSlots : function (){ var t = my.Train; t.TTinpSlots.value = t.stats.barracks - t.stats.queued; }, clickCitySelect : function (city){ var t = my.Train; t.selectedCity = city; t.lastQueString = null; t.lastDQueString = null; t.displayCityStats (); t.changeTroopSelect(); t.changeDefSelect(); }, clickCheckIdlePop : function (){ var t = my.Train; if (document.getElementById ('chkPop').checked) Options.maxIdlePop = true; else Options.maxIdlePop = false; saveOptions (); t.displayCityStats (); t.changeTroopSelect (); }, limitingFactor : null, changeTroopSelect : function (){ var t = my.Train; var cityId = t.selectedCity.id; // unitcost: NAME, Food, Wood, Stone, Ore, Gold, Pop, ? var id = t.TTselType.value; t.lastTroopSelect = id; t.limitingFactor = null; var uc = unsafeWindow.unitcost['unt'+id]; var a=1 var gumble= t.BOGamble.value; if (gumble==0) a=1; if (gumble==1) a=2; if (gumble==2) a=4; var max = 9999999999; if ( (t.stats.food / (uc[1]*a)) < max){ max = t.stats.food / (uc[1]*a); t.limitingFactor = 'food'; } if ( (t.stats.wood / (uc[2]*a)) < max){ max = t.stats.wood / (uc[2]*a); t.limitingFactor = 'wood'; } if ( (t.stats.stone / (uc[3]*a)) < max){ max = t.stats.stone / (uc[3]*a); t.limitingFactor = 'stone'; } if ( (t.stats.ore / (uc[4]*a)) < max){ max = t.stats.ore / (uc[4]*a); t.limitingFactor = 'ore'; } if ( (t.stats.idlePop / uc[6]) < max){ max = t.stats.idlePop / (uc[6]); t.limitingFactor = 'pop'; } t.stats.MaxTrain = parseInt (max); if (t.stats.MaxTrain < 0) t.stats.MaxTrain = 0; if (matTypeof(uc[8]) == 'object'){ for (k in uc[8]){ // check building requirement var b = getCityBuilding (cityId, k.substr(1)); if (b.maxLevel < uc[8][k][1]){ t.stats.MaxTrain = 0; t.limitingFactor = null; break; } } } if (matTypeof(uc[9]) == 'object'){ for (k in uc[9]){ // check tech requirement if (parseInt(Seed.tech['tch'+k.substr(1)]) < uc[9][k][1]){ t.stats.MaxTrain = 0; t.limitingFactor = null; break; } } } //if (t.limitingFactor){ // document.getElementById('ptttr_'+ t.limitingFactor).className = 'boldRed'; //} t.updateTopTroops(); }, clickTroopDo : function (){ var t = my.Train; var cityId = t.selectedCity.id; unsafeWindow.citysel_click(document.getElementById('citysel_'+ (t.selectedCity.idx+1)+'')); var unitId = t.TTselType.value; var perSlot = parseInt(t.TTinpPerSlot.value, 10); var numSlots = parseInt(t.TTinpSlots.value, 10); t.displayCityStats (); if (perSlot<1){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Nombre de troupes par slot incorrect (doit etre > 0)</font>'; return; } if (perSlot*numSlots > t.stats.MaxTrain){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Impossible de former autant de troupes ! (le max est de '+ t.stats.MaxTrain +')</font>'; return; } if (numSlots<1 || numSlots>t.stats.barracks - t.stats.queued){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Nombre incorrect de slots.</font>'; return; } var tut = document.getElementById ('tutelage').value; var gam = t.BOGamble.value; t.setBusy(true); var que = []; for (var i=0; i<numSlots; i++) que.push (['T', unitId, parseInt (perSlot)]); t.divTrainStatus.innerHTML = ''; t.doQueue (cityId, tut, gam, que); }, /******* DEF ******/ updateTopDef : function (){ var t = my.Train; var slots = parseInt(t.TDinpSlots.value, 10); if (isNaN(slots) || slots<0) slots = 0; t.TDspMax.innerHTML = 'max:'+ t.stats.MaxDefTrain +' actuel:'+ t.stats.defOwned; t.TDspMaxSlots.innerHTML = t.stats.wallLevel-t.stats.Dqueued; if (slots<1) t.TDspMaxPS.innerHTML = 0; else t.TDspMaxPS.innerHTML = parseInt(t.stats.MaxDefTrain / slots); t.TDspSpace.innerHTML = '<table border=1 cellspacing=0 width=100% bordercolor=black><tr><td>Niveau</td><td>Défense des Remparts</td><td>Défense des Champs</td></tr>\ <tr><td><B>'+ t.stats.wallLevel +'</b></td><td>'+ (t.stats.wallSpaceUsed+t.stats.wallSpaceQueued) +'/<B>'+ t.stats.wallSpace +'</b></td>\ <td>'+ (t.stats.fieldSpaceUsed+t.stats.fieldSpaceQueued) +'/<B>'+ t.stats.fieldSpace +'</b></td></table>'; }, changeDefSelect : function (){ var t = my.Train; var cityId = t.selectedCity.id; // unitcost: NAME, Food, Wood, Stone, Ore, Gold, Pop, ? var id = t.TDselType.value; t.lastDefSelect = id; t.stats.defOwned = parseInt(Seed.fortifications['city' + cityId]['fort'+id]); var uc = unsafeWindow.fortcost['frt'+id]; var max = 9999999999; if ( (t.stats.food / uc[1]) < max) max = t.stats.food / uc[1]; if ( (t.stats.wood / uc[2]) < max) max = t.stats.wood / uc[2]; if ( (t.stats.stone / uc[3]) < max) max = t.stats.stone / uc[3]; if ( (t.stats.ore / uc[4]) < max) max = t.stats.ore / uc[4]; if ( (t.stats.idlePop / uc[6]) < max) max = t.stats.idlePop / uc[6]; t.stats.MaxDefTrain = parseInt (max); if (t.stats.MaxDefTrain < 0) t.stats.MaxDefTrain = 0; if (matTypeof(uc[8]) == 'object'){ for (k in uc[8]){ // check building requirement var b = getCityBuilding (cityId, k.substr(1)); if (b.maxLevel < uc[8][k][1]){ t.stats.MaxDefTrain = 0; break; } } } if (matTypeof(uc[9]) == 'object'){ for (k in uc[9]){ // check tech requirement if (parseInt(Seed.tech['tch'+k.substr(1)]) < uc[9][k][1]){ t.stats.MaxDefTrain = 0; break; } } } var spaceEach = parseInt(unsafeWindow.fortstats["unt"+ id][5]); if (id<60) var spaceAvail = t.stats.wallSpace - t.stats.wallSpaceUsed - t.stats.wallSpaceQueued; else var spaceAvail = t.stats.fieldSpace - t.stats.fieldSpaceUsed - t.stats.fieldSpaceQueued; if ( t.stats.MaxDefTrain * spaceEach > spaceAvail) t.stats.MaxDefTrain = parseInt(spaceAvail / spaceEach); t.updateTopDef(); }, clickDefMaxPS : function (){ var t = my.Train; var slots = parseInt(t.TDinpSlots.value, 10); if (slots<1) t.TDinpPerSlot.value = 0; else t.TDinpPerSlot.value = parseInt(t.stats.MaxDefTrain / slots); }, clickDefMaxSlots : function (){ var t = my.Train; t.TDinpSlots.value = t.stats.wallLevel-t.stats.Dqueued; }, clickDefDo : function (){ var t = my.Train; var cityId = t.selectedCity.id; var unitId = t.TDselType.value; var perSlot = parseInt(t.TDinpPerSlot.value, 10); var numSlots = parseInt(t.TDinpSlots.value, 10); t.displayCityStats (); if (perSlot<1){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Le nombre d\'unité par slot doit être au dessus de 0.</font>'; return; } if (perSlot*numSlots > t.stats.MaxDefTrain){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Impossible de former, trop d\'unité (le max est de '+ t.stats.MaxDefTrain +')</font>'; return; } if (numSlots<1 || numSlots > t.stats.wallLevel-t.stats.Dqueued){ t.divTrainStatus.innerHTML = '<FONT COLOR=#550000>Nombre de slots incorrecte.</font>'; return; } var siege = document.getElementById ('siege').value; t.setBusy(true); var que = []; for (var i=0; i<numSlots; i++) que.push (['T', unitId, parseInt (perSlot)]); t.divTrainStatus.innerHTML = ''; t.doDefQueue (cityId, siege, que); }, doDefQueue : function (cityId, siege, que, errMsg){ var t = my.Train; try { t.displayCityStats(); if (errMsg){ t.dispTrainStatus ('<font color=#550000><B>ERREUR : '+ errMsg +'</b></font><BR>'); t.setBusy(false); return; } var cmd = que.shift(); if (!cmd){ t.dispTrainStatus ('<B>File d\'attente défenses terminée.</b><BR>'); t.setBusy(false); return; } if (cmd[0] == 'T'){ t.dispTrainStatus ('Construction '+ cmd[2] +' '+ fortNamesShort[cmd[1]] +'<BR>'); doDefTrain ( cityId, siege, cmd[1], cmd[2], function(errMsg){ setTimeout(function (){my.Train.doDefQueue(cityId, siege, que, errMsg);}, (Math.random()*3500)+500); } ); } } catch (err) { //logit (inspect (err, 8, 1)); t.dispTrainStatus ('<font color=#550000>PROGRAMME ERREUR : '+ err.message +'</font><BR>'); t.setBusy(false); } }, setBusy : function (tf){ var t = my.Train; t.TDbutDo.disabled = tf; t.TTbutDo.disabled = tf; }, // fix KofC bugs .... // if first start time > now, make it now // if any end time != next start time, fix it fixQueTimes : function (q){ var now = unixTime(); if (q[0][2] > now) q[0][2] = now; for (var i=0; i<q.length; i++){ if (q[i+1]!=null && q[i+1][2]!=q[i][3]) q[i][3] = q[i+1][2]; } }, displayCityStats : function (){ var t = my.Train; var cityId = t.selectedCity.id; t.stats.food = parseInt (Seed.resources['city'+cityId].rec1[0]/3600); t.stats.wood = parseInt (Seed.resources['city'+cityId].rec2[0]/3600); t.stats.stone = parseInt (Seed.resources['city'+cityId].rec3[0]/3600); t.stats.ore = parseInt (Seed.resources['city'+cityId].rec4[0]/3600); t.stats.gold = Seed.citystats['city'+cityId].gold[0]; if (Options.maxIdlePop) t.stats.idlePop = parseInt(Seed.citystats['city'+cityId].pop[0]); else t.stats.idlePop = parseInt(Seed.citystats['city'+cityId].pop[0]) - parseInt(Seed.citystats['city'+cityId].pop[3]); t.stats.barracks = getCityBuilding (cityId, 13).count; // Consommation en ressource suivant le nombre d'unité choissi // type de troupes : t.TDselType cost = unsafeWindow.unitcost['unt'+t.TTselType.value]; nbunit=t.TTinpPerSlot.value*t.TTinpSlots.value; var a=1 var gumble= t.BOGamble.value; if (gumble==0) a=1; if (gumble==1) a=2; if (gumble==2) a=4; consoFood = cost[1] * a * nbunit; styleFood="";stylePop="";styleWood="";styleOre="";styleStone=""; if (consoFood>t.stats.food) styleFood='style="color:#E30;font-weight:bold;"'; consoOre = cost[4] * a * nbunit; if (consoOre>t.stats.ore) styleOre='style="color:#E30;font-weight:bold;"'; consoStone = cost[3] * a * nbunit; if (consoStone>t.stats.stone) styleStone='style="color:#E30;font-weight:bold;"'; consoWood = cost[2] * a * nbunit; if (consoWood>t.stats.wood) styleWood='style="color:#E30;font-weight:bold;"'; consoPop = cost[6] * nbunit; if (consoPop>t.stats.idlePop) stylePop='style="color:#E30;font-weight:bold;"'; var m = '<TABLE class=ptTab width=100%><TR align=center>\ <TD width=8%><B>Ravi:</b></td><TD width=8%><B>Mili:</b></td><TD width=8%><B>Ecla:</b></td>\ <TD width=8%><B>Piqu:</b></td><TD width=8%><B>Pala:</b></td><TD width=8%><B>Arch:</b></td>\ <TD width=8%><B>Cav:</b></td><TD width=8%><B>CavL:</b></td><TD width=8%><B>Wago:</b></td>\ <TD width=8%><B>Bali:</b></td><TD width=8%><B>Beli:</b></td><TD width=8%><B>Cata:</b></td><tr>'; m += '<TR align=center><TD width=8%>'+Seed.units['city'+cityId]['unt1']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt2']+ '<TD width=8%>'+Seed.units['city'+cityId]['unt3']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt4']+ '<TD width=8%>'+Seed.units['city'+cityId]['unt5']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt6']+ '<TD width=8%>'+Seed.units['city'+cityId]['unt7']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt8']+ '<TD width=8%>'+Seed.units['city'+cityId]['unt9']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt10']+ '<TD width=8%>'+Seed.units['city'+cityId]['unt11']+'</td><TD width=8%>'+Seed.units['city'+cityId]['unt12']+'</td><tr></table>'; m += '<TABLE class=ptTab width=100%><TR align=center>\ <td width=15%> </td><TD width=14%><B>Or :</b></td><TD width=15%><B>Nourriture :</b></td><TD width=14%><B>Bois :</b></td><TD width=14%><B>Pierre :</b></td><TD width=14%><B>Minerais :</b></td><TD width=14%><B>Pop. Inactive :</b></td></tr>\ <TR align=center><td><b>Stock Actuel</b></td><TD><SPAN id=ptttr_gold>'+ addCommasInt(t.stats.gold) +'</span></td><TD><SPAN id=ptttr_food>'+ addCommasInt(t.stats.food) +'</span></td>\ <TD><SPAN id=ptttr_wood>'+ addCommasInt(t.stats.wood) +'</span></td><TD><SPAN id=ptttr_stone>'+ addCommasInt(t.stats.stone) +'</span></td><TD><SPAN id=ptttr_ore>'+ addCommasInt(t.stats.ore) +'</span></td>\ <TD><SPAN id=ptttr_gold>'+ addCommasInt(t.stats.idlePop) +'</span></td></tr>\ <tr align=center><td width=15%><b>Stock Requis</b></td><td> </td><td '+styleFood+'>'+addCommasInt(consoFood)+'</td><td '+styleWood+'>'+addCommasInt(consoWood)+'</td><td '+styleStone+'>'+addCommasInt(consoStone)+'</td><td '+styleOre+'>'+addCommasInt(consoOre)+'</td>\ <TD '+stylePop+'>'+ addCommasInt(consoPop)+'</td></tr>\ </table>'; document.getElementById ('divSTtop').innerHTML = m; // TEMPS ESTIME poru la construction var e=parseInt((t.TDinpPerSlot.value*t.TDinpSlots.value),10); if (e>0) { d=t.TDselType.value; var a=unsafeWindow.modal_walls_traintime(d,e) var reduction=0 var tut = document.getElementById('siege').value; if (tut==26) reduction=parseInt(a*0.3); var reducStr=timestr(reduction,1); document.getElementById('BOmodal_barracks_deftime').innerHTML="Durée : <b>" + timestr(a,1) +"</b>"; if (reduction>0) { var totalred = a - reduction; document.getElementById('BOmodal_barracks_deftime').innerHTML="Durée : <b>" + timestr(totalred,1) +"</b>"; document.getElementById('BOmodal_barracks_deftime').title="Durée : " + timestr(a,1) +" - Réduction : " + reducStr + ""; } } // CALCUL DU TEMPS ESTIMER !!! TROUPEs var e=parseInt(nbunit,10); var b=t.TTselType.value; var m=0; if(e>0){ var m=parseInt(parseInt(unsafeWindow.unitcost["unt"+b][7]))*e; var c=0; var d=0; var h=0; var j=Object.keys(Seed.buildings["city"+cityId]); for(var f=0;f<j.length;f++){ var k=Seed.buildings["city"+cityId][j[f]]; if((parseInt(k[0])==13)&&(parseInt(k[1])>0)){ c+=(parseInt(k[1])+9) } if((parseInt(k[0])==16)&&(parseInt(k[1])>d)){ if(parseInt(b)>=9){ d=parseInt(k[1]) } } if((parseInt(k[0])==17)&&(parseInt(k[1])>h)){ if(parseInt(b)>=7){ h=parseInt(k[1]) } } } var a=c/10; var l=0; var g=0; var n=Seed.knights["city"+cityId]; m=Math.max(1,Math.ceil(m/a)); a=1; l=d+h; if(n){ n=n["knt"+Seed.leaders["city"+cityId].combatKnightId]; if(n){ g=parseInt(n.combat); newkntlv=((parseInt(n.combatBoostExpireUnixtime)-unixTime())>0)?(g*1.25):g; a=a+(0.005*newkntlv) } } if(Seed.tech){ l=l+Seed.tech.tch5; } a=a+(0.1*l); m=Math.max(1,Math.ceil(m/a)); var reduction=0 var tut = document.getElementById ('tutelage').value; if (tut==36) reduction=parseInt(m*0.3,10); if (tut==37) reduction=parseInt(m*0.5,10); if (tut==38) reduction=parseInt(m*0.7,10); var reducStr=timestr(reduction,1); var aa=1; // temps normal ! document.getElementById('BOmodal_barracks_traintime').innerHTML="Durée : <b>" + timestr(m,1) +""; // temps avec réduction sans tutelle var gumble= t.BOGamble.value; if (gumble==0) aa=1; if (gumble==1) aa=2; if (gumble==2) aa=4; if (aa>1 && reduction==0) { if (aa==2) { var r1=parseInt(m*0.05,10); var r2=parseInt(m*0.15,10); var n1 = m - r1; var n2 = m - r2; } if (aa==4) { var r1=parseInt(m*0.10,10); var r2=parseInt(m*0.25,10); var n1 = m - r1; var n2 = m - r2; } document.getElementById('BOmodal_barracks_traintime').innerHTML="Durée entre <b><font color=red>" + timestr(n2,1) +"</font> et <font color=red>" + timestr(n1,1) +"</font>"; } else { } // temps sans réduction avec tutelle if (reduction>0 && aa==1) { var totalred = m - reduction; document.getElementById('BOmodal_barracks_traintime').innerHTML="Durée : <b><font color=red>" + timestr(totalred,1) +"</font></b>"; document.getElementById('BOmodal_barracks_traintime').title="Durée : " + timestr(m,1) +" - Réduction : " + reducStr + ""; } // temps avec réduction et tutelle if (reduction>0 && aa>1) { var totalred = m - reduction; if (aa==2) { var r1=parseInt(totalred*0.05,10); var r2=parseInt(totalred*0.15,10); var n1 = totalred - r1; var n2 = totalred - r2; } if (aa==4) { var r1=parseInt(totalred*0.10,10); var r2=parseInt(totalred*0.25,10); var n1 = totalred - r1; var n2 = totalred - r2; } document.getElementById('BOmodal_barracks_traintime').innerHTML="Durée entre <b><font color=red>" + timestr(n2,1) +"</font> et <font color=red>" + timestr(n1,1) +"</font>"; // document.getElementById('BOmodal_barracks_traintime').innerHTML="Durée : <b><font color=red>" + timestr(totalred,1) +"</font></b>"; // document.getElementById('BOmodal_barracks_traintime').title="Durée : " + timestr(m,1) +" - Réduction : " + reducStr + ""; } } // troop queue .... var totTime = 0; var q = Seed.queue_unt['city'+cityId]; var c = Cities.byID[cityId].idx; t.stats.queued = q.length; var qs = q.toString(); var now = unixTime(); if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if ( qs == t.lastQueString){ if (q!=null && q.length>0){ var cur = q[0][3] - now; if (cur < 1) q.shift(); if (document.getElementById ('ptttfq')) document.getElementById ('ptttfq').innerHTML = timestr(cur, true); } } else { t.lastQueString = qs; t.stats.queued = 0; m = '<TABLE align=center class=ptTab>'; if (q!=null && q.length>0 ){ t.fixQueTimes (q); t.stats.queued = q.length; first = true; for (var i=0; i<q.length; i++){ start = q[i][2]; end = q[i][3]; if (first) actual = end - now; else actual = end - lastEnd; if (actual < 0) actual = 0; param1=i; // numéro de position dans la fil d'attente param2=cityId; // id de la ville param3=q[i][0]; // Type de trouoe param4=q[i][1]; // Qte troupe param5=end; // debut param6=start; // fin param7=actual; // duree m += '<TR align=right><td width=35 align=center>'+(i+1)+' <a onclick="BOcancelTraining('+param1+','+param2+','+param3+','+param4+','+param5+','+param6+','+param7+');return false;" href="javascript:void(0);"><img src="http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png" border=0 title="Annuler la formation"></a></td><TD>'+ q[i][1] +' </td><TD align=left> '+ unsafeWindow.unitcost['unt'+q[i][0]][0].replace('de Ravitaillement',''); if (first) m += '</td><TD> <img src="http://cdn1.iconfinder.com/data/icons/ledicons/wait.png" onclick=citysel_click(document.getElementById(\'citysel_'+ (c+1)+'\'));modal_speedup("trn",'+param3+','+param3+',"Training",'+param6+');return false;> '+ timestr(end-start, true) +'</td><TD> (<SPAN id=ptttfq>'+ timestr(actual, true) +'</span>)'; else m += '</td><TD> '+ timestr(actual, true) +'</td></tr>'; lastEnd = end; first = false; } } m += '</table>'; document.getElementById ('divSTleft').innerHTML = m; } m = t.stats.barracks +' casernes'; if (t.stats.queued > 0) m += ', '+ t.stats.queued +' slots'; if (totTime > 0) m += ', '+ unsafeWindow.timestr(totTime); document.getElementById ('statTTtot').innerHTML = m; // defense queue .... getWallInfo (cityId, t.stats); var totTime = 0; var q = Seed.queue_fort['city'+cityId]; var qs = q.toString(); if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if ( qs == t.lastDQueString){ if (q!=null && q.length>0){ var cur = q[0][3] - now; if (cur < 1) q.shift(); document.getElementById ('pttdfq').innerHTML = timestr(cur, true); } } else { t.lastDQueString = qs; t.stats.Dqueued = 0; t.stats.wallSpaceQueued = 0; t.stats.fieldSpaceQueued = 0; m = '<TABLE align=center class=ptTab>'; if (q!=null && q.length > 0 ){ t.fixQueTimes (q); t.stats.Dqueued = q.length; first = true; for (i=0; i<q.length; i++){ if (q[i][0] < 60) t.stats.wallSpaceQueued += parseInt(unsafeWindow.fortstats["unt"+ q[i][0]][5]) * parseInt(q[i][1]); else t.stats.fieldSpaceQueued += parseInt(unsafeWindow.fortstats["unt"+ q[i][0]][5]) * parseInt(q[i][1]); start = q[i][2]; end = q[i][3]; if (first) actual = end - now; else actual = end - lastEnd; if (actual < 0) actual = 0; q[i][7]=cityId; m += '<TR align=right><TD><a onclick="BOcancelFort('+ q[i][0]+','+q[i][1]+','+q[i][2]+','+q[i][3]+','+q[i][5]+','+q[i][6]+','+q[i][7] +','+ i +');return false;" href="javascript:void(0);"><img src="http://cdn1.iconfinder.com/data/icons/musthave/16/Remove.png" border=0 title="Annuler la fortification"></a></td><TD>'+ q[i][1] +'</td><TD align=left> '+ fortNamesShort[q[i][0]]; if (first) m += '</td><TD> '+ timestr(end-start, true) +'</td><TD> (<SPAN id=pttdfq>'+ timestr(actual, true) +'</span>)'; else m += '</td><TD> '+ timestr(actual, true) +'</td></tr>'; lastEnd = end; first = false; } } m += '</table>'; document.getElementById ('divSTright').innerHTML = m; } m = t.stats.Dqueued +' slots'; if (totTime > 0) m += ', '+ unsafeWindow.timestr(totTime); document.getElementById ('statDTtot').innerHTML = m; }, dispTrainStatus : function (msg){ var t = my.Train; t.divTrainStatus.innerHTML = msg + t.divTrainStatus.innerHTML; }, CancelActionall: function(num, fintraitement) { var t = my.Train; var cityId = t.selectedCity.id; var q = Seed.queue_unt['city'+cityId]; var now = unixTime(); start = q[num][2]; end = q[num][3]; if (first) actual = end - now; else actual = end - lastEnd; if (actual < 0) actual = 0; var param2=cityId; // id de la ville var param3=q[num][0]; // Type de trouoe var param4=q[num][1]; // Qte troupe var param5=end; // debut var param6=start; // fin var param7=actual; // duree //// on refait.. pfff // document.getElementById("divSTleft").innerHTML="<br><i>Patientez...</i>"; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cityId = param2; params.requestType ="CANCEL_TRAINING"; params.numtrptrn = param4; params.trnETA= param5; params.trnNeeded = param7; params.trnTmp = param6; params.typetrn= param3; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelTraining.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { var t = my.Train; if (rslt.ok) { unsafeWindow.update_seed_ajax(true,function(){ var k=0;for(var j=0;j<unsafeWindow.seed.queue_unt["city"+param2].length;j++){ if(j>num){ unsafeWindow.seed.queue_unt["city"+param2][j][2]=parseInt(rslt.dateTraining[k]["start"]); unsafeWindow.seed.queue_unt["city"+param2][j][3]=parseInt(rslt.dateTraining[k]["end"]); k++; } } unsafeWindow.seed.queue_unt["city"+param2].splice(num,1); for(var i=1;i<5;i++){ var totalReturn=parseInt(unsafeWindow.unitcost["unt"+param3][i])*parseInt(param4)*3600/2; unsafeWindow.seed.resources["city"+param2]["rec"+i][0]=parseInt(unsafeWindow.seed.resources["city"+param2]["rec"+i][0])+totalReturn; } }); // on passe auivant s'il y en a un lol var numnew = num - 1; if (numnew<fintraitement) { t.dispTrainStatus ('<font color=#550000><B>Annulation des formations réussie</b></font><BR>'); document.getElementById ('BOCancelAllTrain').style.display='block'; t.displayCityStats(); //return; /// fini on arrete } else { setTimeout(function (){ t.CancelActionall(numnew, fintraitement); }, (Math.random()*1000)+1000 ); } } else { t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler les formations...<br>Actualisez le jeu et recommencer.</b></font><BR>"); t.displayCityStats(); document.getElementById ('BOCancelAllTrain').style.display='block'; } }, onFailure: function (rslt) { var t = my.Train; t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler les formations...<br>Actualisez le jeu et recommencer.</b></font><BR>"); t.displayCityStats(); document.getElementById ('BOCancelAllTrain').style.display='block'; } }); }, CancelAllTraining : function() { var t = my.Train; // Annulation des formations sur la ville choisit var cityId = t.selectedCity.id; var q = Seed.queue_unt['city'+cityId]; if (q.length>0) { var b=prompt("A partir de quel slot voulez-vous annuler ? (1=formation en cours a "+(q.length)+")", 2); if (parseInt(b)<=q.length && parseInt(b)>0) { t.dispTrainStatus ('<font color=#550000><B>Annulation des formation en cours... MERCI DE PATIENTER !</b></font><BR>'); document.getElementById ('BOCancelAllTrain').style.display='none'; t.CancelActionall(q.length-1, b-1); } } }, cancelTrainingBO : function (p1,p2,p3,p4,p5,p6,p7) { // Procédure d'annulation de formation var t = my.Train; //document.getElementById("divSTleft").innerHTML="<br><i>Patientez...</i>"; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cityId = p2; params.requestType ="CANCEL_TRAINING"; params.numtrptrn = p4; params.trnETA= p5; params.trnNeeded = p7; params.trnTmp = p6; params.typetrn= p3 new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelTraining.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { var t = my.Train; if (rslt.ok) { unsafeWindow.update_seed_ajax(true,function(){ var k=0;for(var j=0;j<unsafeWindow.seed.queue_unt["city"+p2].length;j++){ if(j>p1){ unsafeWindow.seed.queue_unt["city"+p2][j][2]=parseInt(rslt.dateTraining[k]["start"]); unsafeWindow.seed.queue_unt["city"+p2][j][3]=parseInt(rslt.dateTraining[k]["end"]); k++; } } unsafeWindow.seed.queue_unt["city"+p2].splice(p1,1); for(var i=1;i<5;i++){ var totalReturn=parseInt(unsafeWindow.unitcost["unt"+p3][i])*parseInt(p4)*3600/2; unsafeWindow.seed.resources["city"+p2]["rec"+i][0]=parseInt(unsafeWindow.seed.resources["city"+p2]["rec"+i][0])+totalReturn; } }); t.dispTrainStatus ('<font color=#550000><B>Annulation de la formation réussie</b></font><BR>'); t.displayCityStats(); } else { t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler la formation...</b></font><BR>"); t.displayCityStats(); } }, onFailure: function (rslt) { var t = my.Train; t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler la formation...</b></font><BR>"); t.displayCityStats(); } }); }, butcancelFort : function (typefrt, numtrpfrt, frtTmp, frtETA, frtNeeded, frtid, cityId, queueId){ var t = my.Train; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf =0; params.requestType = "CANCEL_FORTIFICATIONS"; params.cityId = cityId; params.typefrt = typefrt; params.numtrpfrt = numtrpfrt; params.frtETA = frtETA; params.frtTmp = frtTmp; params.frtNeeded = frtNeeded; params.frtid = frtid; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelFortifications.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (message) { var rslt=eval("("+message.responseText+")"); var t = my.Train; if (rslt.ok) { var k=0; for(var j=0;j<Seed.queue_fort["city"+cityId].length;j++){ if(j>queueId){ Seed.queue_fort["city"+cityId][j][2]=parseInt(rslt.dateFortifications[k]["start"]); Seed.queue_fort["city"+cityId][j][3]=parseInt(rslt.dateFortifications[k]["end"]); k++; } } unsafeWindow.update_seed(rslt.updateSeed); Seed.queue_fort["city"+cityId].splice(queueId,1); for(var i=1;i<5;i++){ var totalReturn=parseInt(unsafeWindow.fortcost["frt"+typefrt][i])*parseInt(numtrpfrt)*3600/2; Seed.resources["city"+cityId]["rec"+i][0]=parseInt(Seed.resources["city"+cityId]["rec"+i][0])+totalReturn; } t.dispTrainStatus ('<font color=#550000><B>Annulation de la fortification réussie</b></font><BR>'); t.displayCityStats(); } else { t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler la fortification...</b></font><BR>"); t.displayCityStats(); } }, onFailure: function () { var t = my.Train; t.dispTrainStatus ("<font color=#550000><B>ERREUR : Impossible d'annuler la fortification...</b></font><BR>"); t.displayCityStats(); }, }); }, doQueue : function (cityId, tut, gam, que, errMsg){ var t = my.Train; try { t.displayCityStats(); if (errMsg){ t.dispTrainStatus ('<font color=#550000><B>ERREUR : '+ errMsg +'</b></font><BR>'); t.setBusy(false); return; } var cmd = que.shift(); if (!cmd){ t.dispTrainStatus ('<B>File d\'attente des troupes terminée.</b><BR>'); t.setBusy(false); return; } if (cmd[0] == 'T'){ t.dispTrainStatus ('Formation '+ cmd[2] +' '+ unsafeWindow.unitcost['unt'+cmd[1]][0] +' dans '+ Cities.byID[cityId].name +' ('+ que.length +' slot(s) restant(s))<BR>'); doTrain (cityId, tut, gam, cmd[1], cmd[2], function(errMsg){ setTimeout(function (){my.Train.doQueue(cityId, tut, gam, que, errMsg);}, (Math.random()*1000)+1000 ); } ); } } catch (err) { t.dispTrainStatus ('<font color=#550000>PROGRAME ERREUR : '+ err.message +'</font><BR>'); t.setBusy(false); } }, } /*************************************** OVERVIEW TAB ************************************************/ function getResourceProduction (cityId){ var ret = [0,0,0,0,0]; var now = unixTime (); var wilds = [0, 0, 0, 0, 0]; var w = Seed.wilderness["city" + cityId]; for (var k in w){ var type = parseInt(w[k].tileType); if (type==10 || type==11) wilds[1] += parseInt(w[k].tileLevel); else wilds[type/10] += parseInt(w[k].tileLevel); } knight = 0; var s = Seed.knights["city" + cityId]; if (s) { s = s["knt" + Seed.leaders["city" + cityId].resourcefulnessKnightId]; if (s){ var knight = parseInt(s.resourcefulness); if (s.resourcefulnessBoostExpireUnixtime > now) knight *= 1.25; } } var workerFactor = 1; var c = parseInt(Seed.citystats["city" + cityId]["pop"][0]); // Current population var w = parseInt(Seed.citystats["city" + cityId]["pop"][3]); // Labor force if (w > c) workerFactor = c / w; for (var i=1; i<5; i++){ var usage = Seed.resources["city" + cityId]["rec" + i]; var items = 0; if (parseInt(Seed.playerEffects["r" + i + "BstExp"]) > now) { items = 0.25; } var tech = Seed.tech["tch" + i]; ret[i] = parseInt((usage[2] * (1 + tech/10 + knight/100 + items + 0.05 * wilds[i]) * workerFactor + 100)); } return ret; } /*********************************** Test TAB ***********************************/ myBO.Test = { tabOrder: 25, tabDisabled : false, tabLabel : 'Test', myDiv : null, cont : null, init : function (){ // called once, upon script startup this.myDiv = document.createElement('div'); return this.myDiv; }, hide : function (){ var t = myBO.Test; }, getContent : function (){ return myBO.Test.myDiv; }, show : function (){ var t = myBO.Test; t.cont = this.myDiv; var citySelect = ' <SELECT id=fakeCity>'; for (var c=0; c<Cities.numCities; c++) { aCity = Cities.cities[c].name + ' ('+Cities.cities[c].x + ','+ Cities.cities[c].y+')'; citySelect += '<option value=\''+c+'\'>'+aCity+'</option>'; } citySelect += '</select>'; var m = '<TABLE><TR><TD align=right>Eclairage</td><TD><INPUT type=checkbox id=fakeIsScout></td><TD align=right>Terre Sauvage</td><TD><INPUT type=checkbox id=fakeIsWild></td></tr>\ <TR><TD align=right>Faux Rapport</td><TD><INPUT type=checkbox disabled id=fakeFalse></td><TD align=right>Secondes </td><TD><INPUT type=text size=4 value=300 id=fakeSeconds></td></tr>\ <TR><TD align=right>ravitailleurs </td><TD><INPUT type=text size=6 value=0 id=faketroop0></td><TD align=right>miliciens </td><TD><INPUT type=text size=6 value=1 id=faketroop1></td></tr>\ <TR><TD align=right>eclaireurs </td><TD><INPUT type=text size=6 value=0 id=faketroop2></td><TD align=right>piquiers </td><TD><INPUT type=text size=6 value=0 id=faketroop3></td></tr>\ <TR><TD align=right>paladins </td><TD><INPUT type=text size=6 value=0 id=faketroop4></td><TD align=right>archers </td><TD><INPUT type=text size=6 value=0 id=faketroop5></td></tr>\ <TR><TD align=right>cavalerie </td><TD><INPUT type=text size=6 value=0 id=faketroop6></td><TD align=right>cavalerie lourde </td><TD><INPUT type=text size=6 value=0 id=faketroop7></td></tr>\ <TR><TD align=right>wagons </td><TD><INPUT type=text size=6 value=0 id=faketroop8></td><TD align=right>balistes </td><TD><INPUT type=text size=6 value=0 id=faketroop9></td></tr>\ <TR><TD align=right>beliers </td><TD><INPUT type=text size=6 value=0 id=faketroop10></td><TD align=right>catapultes </td><TD><INPUT type=text size=6 value=0 id=faketroop11></td></tr>\ <TR><TD align=right>Nom Attaquant</td><TD><INPUT type=text size=13 value="Kabam!" id=fakeName></td><td align=right>Puissance</td><td><INPUT type=text size=13 value="5441192" id=fakeMight></td></tr>\ <TR><TD align=right>Ville cible</td><TD>'+citySelect+'</td><td><INPUT id=testSendMarch type=submit value="Fausse Attaque" \></td></tr>'; m+='</td></tr></table>\ <INPUT id=ptReloadKOC type=submit value="Recharger KOC" \>\ <BR><DIV id=testDiv style="background-color:#fffff0; maxwidth:675; max-height:30px; height:0px; overflow-y:auto;"></div>'; t.cont.innerHTML = m; document.getElementById('testSendMarch').addEventListener ('click', t.clickFakeAttack, false); document.getElementById('ptReloadKOC').addEventListener ('click', t.reloadKOC, false); function xyNotify(city, x, y){ var m = '[ Notified: '+ (city?city.name:'null') +', x='+ x +', y='+ y +' ]'; document.getElementById('testNotify').innerHTML = m; } }, writeDiv : function (msg){ var t = myBO.Test; if (t.state != null) document.getElementById('testDiv').innerHTML = msg; }, addDiv : function (msg){ var t = myBO.Test; if (t.state != null) document.getElementById('testDiv').innerHTML += msg; }, reloadKOC : function (){ var goto = 'http://apps.facebook.com/kingdomsofcamelot/?s='+getServerId(); var t = '<FORM target="_top" action="'+ goto +'" method=post><INPUT id=xxptButReload type=submit value=RELOAD><INPUT type=hidden name=s value="'+ getServerId() +'"</form>'; var e = document.createElement ('div'); e.innerHTML = t; document.body.appendChild (e); setTimeout (function (){document.getElementById('xxptButReload').click();}, 0); }, createFakeAttack : function (cityNum, isScout, isWild, isFalse, secs, troops, name, might){ var marchId = 'm'+ (88888 + Math.floor(Math.random()*11111)); var march = {}; if (matTypeof(Seed.queue_atkinc)=='array') Seed.queue_atkinc = {}; if (isFalse) march.marchType = 0; else if (isScout) march.marchType = 3; else march.marchType = 4; march.toCityId = Cities.cities[cityNum].id; if (isWild) { keys = unsafeWindow.Object.keys(Seed.wilderness['city'+Cities.cities[cityNum].id]); march.toTileId = Seed.wilderness['city'+Cities.cities[cityNum].id][keys[0]].tileId; } else { march.toTileId = Cities.cities[cityNum].tileId; } secs = parseInt(secs); march.arrivalTime = unixTime() + secs; march.departureTime = unixTime() - 10; march.unts = {} for(i=0; i<12; i++){ if(troops[i] > 0) march.unts["u"+(i+1)] = addCommas(troops[i]); } march.pid = 1234567; march.score = 9; march.mid = marchId.substr(1); march.players = {} march.players.u1234567 = {} march.players.u1234567.n = name; march.players.u1234567.t = 60; march.players.u1234567.m = might; march.players.u1234567.s = 'M'; march.players.u1234567.w = 1; march.players.u1234567.a = 1; march.players.u1234567.i = 5; Seed.queue_atkinc[marchId] = march; Seed.players.u1234567 = march.players.u1234567; }, clickFakeAttack : function (){ var t = myBO.Test; var isScout = document.getElementById('fakeIsScout').checked; var isWild = document.getElementById('fakeIsWild').checked; var isFalse = document.getElementById('fakeFalse').checked; var troops = []; for(i=0; i<12; i++) troops[i] = parseInt(document.getElementById('faketroop'+i).value); var secs = parseInt(document.getElementById('fakeSeconds').value); var name = document.getElementById('fakeName').value; var city = document.getElementById('fakeCity').value; var might = document.getElementById('fakeMight').value; t.createFakeAttack (city, isScout, isWild, isFalse, secs, troops ,name,might); }, } /**************************** Script Tab ******************************/ myBO.map = { tabOrder : 35, // order to place tab in top bar tabLabel : 'Map', // label to show in main window tabs cont : null, timer : null, forumlink : 'http://koc.dunno.com/index.sjs?f=ListServers', // init : function (){ // called once, upon script startup this.cont = document.createElement('div'); return this.cont; }, getContent : function (){ return myBO.map.cont; }, hide : function (){ // called whenever the main window is hidden, or another tab is selected var t = myBO.map; //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 350 + 'px' }, show : function (){ // called whenever this tab is shown var t = myBO.map; try { var numdo=unsafeWindow.domainName.substr(unsafeWindow.domainName.length-3); t.forumlink='http://koc.dunno.com/index.sjs?f=KocMapViewer&server_id='+numdo; } catch(e) { } cont.innerHTML = '<CENTER><iframe src="'+ t.forumlink +'" width="100%" height="550" name="board_in_a_box"> </iframe> <BR></center>'; //mainPop2.div.style.width = 1110 + 'px'; // mainPop2.div.style.height = 550 + 'px' }, } /*********************************** Alliance TAB ***********************************/ myBO.Alliance = { tabOrder : 120, cont : null, alliancemembers:[], number:0, totalmembers:0, error:false, getContent : function (){ var t = myBO.Alliance; return t.cont; }, init : function (){ var t = myBO.Alliance; t.cont = document.createElement('div'); return t.cont; }, show : function (){ var t = myBO.Alliance; t.cont.style.overflowY = 'scroll'; //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 550 + 'px' t.cont.style.maxHeight = '500px'; t.totalmembers=0; t.alliancemembers=[]; unsafeWindow.getdetails = t.getMemberDetails; var m = '<DIV class=ptstat>INFORMATIONS SUR L\'ALLIANCE</div><TABLE align=center cellpadding=1 cellspacing=0></table>'; m +='<TABLE class=ptTab><TD width=200px>Liste des membres de l\'alliance</td><TD>Trier par : <select id="searchAlli"><option value="name">Nom</options>'; m += '<option value="might">Puissance</option>'; m += '<option value="login">Derni&egrav;re connexion Login</option>'; m += '<option value="cities">Villes</option>'; m += '<option value="position">Position</option>'; m += '<option value="dip">Jour dans cette position (dip)</option></select></td>'; m += '<TD><INPUT id=alList type=submit value="Liste"></td>'; m += '<TD id=progress></td>'; m += '<TR><TD width=200px>Voir les diplomaties de l\'alliance</td><TD><INPUT id=aldiplo type=submit value="Liste des diplomaties"></td></tr></table>'; m+='<DIV class=ptstat>RESUME</div><TABLE align=center cellpadding=1 cellspacing=0></table>'; m += '<TABLE id=alOverviewTab class=alTab><TR align="center"></tr></table>'; t.cont.innerHTML = m; document.getElementById('alList').addEventListener('click', function(){ if (!t.searching){ t.totalmembers=0; t.alliancemembers=[]; document.getElementById('alOverviewTab').innerHTML =""; document.getElementById('progress').innerHTML =""; document.getElementById('progress').innerHTML = "Recherche en cours..."; document.getElementById('alList').disabled = true; t.error=false; t.fetchAllianceMemberPage(); } }, false); document.getElementById('searchAlli').addEventListener('click', function(){ if (t.alliancemembers!="") { document.getElementById('alOverviewTab').innerHTML =""; t.paintMembers(); } }, false); document.getElementById('aldiplo').addEventListener('click', function(){t.paintDiplomacy();}, false); window.addEventListener('unload', t.onUnload, false); }, paintMembers: function(){ var t = myBO.Alliance; if (document.getElementById('searchAlli').value == "name") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Name.toLowerCase(), sortB=b.Name.toLowerCase() if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "might") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=parseInt(a.Might),sortB=parseInt(b.Might) if (sortA > sortB) return -1 if (sortA < sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "login") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.LastLogin,sortB=b.LastLogin if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "cities") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Cities,sortB=b.Cities if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "dip") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.dip,sortB=b.dip if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } if (document.getElementById('searchAlli').value == "position") { var sortmembers = t.alliancemembers.sort(function(a, b){ var sortA=a.Position,sortB=b.Position if (sortA < sortB) return -1 if (sortA > sortB) return 1 return 0 }); } for (var y = (sortmembers.length-1); y >=0; y--) { t._addTab(sortmembers[y].Name,sortmembers[y].Might,sortmembers[y].LastLogin,sortmembers[y].Position,sortmembers[y].dip,sortmembers[y].uid,sortmembers[y].fbuid,sortmembers[y].Cities); t.cont.style.overflowY = 'scroll'; } t._addTabHeader(); }, _addTab: function(Name,Might,LastLogin,Position,dip,uid,fbuid,Cities){ var t = myBO.Alliance; var row = document.getElementById('alOverviewTab').insertRow(0); row.vAlign = 'top'; row.insertCell(0).innerHTML ='<A target="_tab" href="http://www.facebook.com/profile.php?id='+ fbuid +'">Profile</a>'; row.insertCell(1).innerHTML = Name; var cell2 = row.insertCell(2); cell2.width = "60" ; cell2.align = "right" ; cell2.vAlign = "top"; cell2.innerHTML = addCommas(Might); row.insertCell(3).innerHTML = Cities; row.insertCell(4).innerHTML = officerId2String (Position); row.insertCell(5).innerHTML = dip; row.insertCell(6).innerHTML = LastLogin; }, _addTabHeader: function() { var t = myBO.Alliance; var row = document.getElementById('alOverviewTab').insertRow(0); row.vAlign = 'top'; row.insertCell(0).innerHTML = "Facebook"; row.insertCell(1).innerHTML = "Nom"; row.insertCell(2).innerHTML = "Puissance"; row.insertCell(3).innerHTML = "Villes"; row.insertCell(4).innerHTML = "Position"; row.insertCell(5).innerHTML = "DIP"; row.insertCell(6).innerHTML = "Connexion"; }, paintDiplomacy : function () { document.getElementById('alOverviewTab').innerHTML =""; document.getElementById('progress').innerHTML =""; var m= '<TR><TD colspan=4 style=\'background: #33CC66;\' align=center><B>Amical : </b></td></tr>'; if (Seed.allianceDiplomacies['friendly'] == null) m+='<TR><TD>Aucune alliance...</td>'; else m += '<TABLE class=xtab><TR><TD>Nom de l\'Alliance</td><TD>Classé Membres</td></tr>'; for (k in Seed.allianceDiplomacies['friendly']){ m+='<TR><TD>'+Seed.allianceDiplomacies['friendly'][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies['friendly'][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; m+= '<TR><TD colspan=4 style=\'background: #CC0033;\' align=center><B>Hostile : </b></td></tr>'; if (Seed.allianceDiplomacies['hostile'] == null) m+='<TR><TD>Aucune alliance...</td>'; else m += '<TABLE class=xtab><TR><TD>Nom de l\'Alliance</td><TD>Classé Membres</td></tr>'; for (k in Seed.allianceDiplomacies["hostile"]){ m+='<TR><TD>'+Seed.allianceDiplomacies["hostile"][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies["hostile"][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; m+= '<TR><TD colspan=4 style=\'background: #FF6633;\' align=center><B>Amicalement pour vous : </b></td></tr>'; if (Seed.allianceDiplomacies['friendlyToYou'] == null) m+='<TR><TD>Aucunce alliance...</td>'; else m += '<TABLE class=xtab><TR><TD>Nom de l\'Alliance</td><TD>Classé Membres</td></tr>'; for (k in Seed.allianceDiplomacies["friendlyToYou"]){ m+='<TR><TD>'+Seed.allianceDiplomacies["friendlyToYou"][k]['allianceName']+'</td>'; m+='<TD align=center>'+Seed.allianceDiplomacies["friendlyToYou"][k]['membersCount']+'</td>'; } m+='<TR></tr></table>'; document.getElementById('alOverviewTab').innerHTML = m; }, fetchAllianceMemberPage : function () { var t = myBO.Alliance; document.getElementById('alList').disabled = true; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pf = 0; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (transport) { var rslt = eval("(" + transport.responseText + ")"); t.totalmembers = (rslt["allianceInfo"]["members"]); for (var i=1;i<=10;i++) { params.pageNo = i; params.pf = 0; new AjaxRequest(unsafeWindow.g_ajaxpath + "ajax/allianceGetMembersInfo.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (transport) { var info = eval("(" + transport.responseText + ")"); if (info.ok) { for (var k in info["memberInfo"]){ if ( info["memberInfo"][k]["might"] != undefined && !t.error){ t.alliancemembers.push ({ Name: info["memberInfo"][k]["name"], Might: info["memberInfo"][k]["might"], Cities: info["memberInfo"][k]["cities"], Position : info["memberInfo"][k]["positionType"], dip : info["memberInfo"][k]["daysInPosition"], LastLogin : info["memberInfo"][k]["lastLogin"], uid : info["memberInfo"][k]["userId"], fbuid : info["memberInfo"][k]["fbuid"], }); } document.getElementById('alOverviewTab').innerHTML =""; t.paintMembers(); } if (!t.error) document.getElementById('progress').innerHTML = '(' + (t.alliancemembers.length) +'/'+ t.totalmembers +')'; if ( t.alliancemembers.length >= t.totalmembers) document.getElementById('alList').disabled = false; } else if (info.error) { document.getElementById('alList').disabled = false; document.getElementById('progress').innerHTML = "ERROR!"; t.error=true; } }, onFailure: function (rslt) {; notify ({errorMsg:'AJAX error'}); }, }); } }, onFailure: function (rslt) {; notify ({errorMsg:'AJAX error'}); }, }); }, hide : function (){ //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 350 + 'px' }, }; /****************** OVERVIEW RESSOURCES ***********/ myBO.Overview = { cont : null, displayTimer : null, checkBox:null, checkBox1:null, Overview : function (){ }, init : function (){ this.cont = document.createElement('div'); return this.cont; }, getContent : function (){ return myBO.Overview.cont; }, hide : function (){ clearTimeout (myBO.Overview.displayTimer); }, show : function (){ // mainPop2.div.style.width = 749 + 'px'; // mainPop2.div.style.height = 350 + 'px' var rownum = 0; var totalentre = 0; var t = myBO.Overview; clearTimeout (t.displayTimer); function _row (name, row, noTotal, typee){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push ('</td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += row[i]; m.push ('<TD style="background: #ffc">'); if (tot<0) { m.push ("<SPAN class=class=boldRed>"+addCommas(tot)+"</span>"); } else { m.push (addCommas(tot)); } //} m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); m.push (addCommas(row[i])); m.push ('</td>'); } m.push ('</tr>'); return m.join(''); } try { if (Options.includeMarching) march = getMarchInfo (); dt = new Date (); dt.setTime (Seed.player.datejoinUnixTime * 1000); var now = unixTime(); str = "<TABLE class=ptTabLined cellspacing=0><TR valign=top align=right><TD width=65></td><TD width=88 style='background: #ffc'><B>TOTAL</b></td>"; for(i=0; i<Cities.numCities; i++) { str += "<TD width=81><B>"+ Cities.cities[i].name.substring(0,10) +'</b></td>'; } if (Options.includeMarching) str += '<TD width=81><B>Marchant</b></td>'; str += "<td></td></tr>"; rows = []; rows[0] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[0][i] = parseInt(Seed.citystats[cityID].gold[0]); } for (r=1; r<5; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.resources[cityID]['rec'+r][0] / 3600); } } if (Options.includeMarching){ for (var i=0; i<5; i++) rows[i][Cities.numCities] = march.resources[i]; } str += _row ('<img title="Stock d\'or" height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_30.png>', rows[0], false, 0); str += _row ('<img title="Stock de nourriture" height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png>', rows[1], false, 0); str += _row ('<img title="Stock de bois" height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png>', rows[2], false, 0); str += _row ('<img title="Stock de pierre" height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png>', rows[3], false, 0); str += _row ('<img title="Stock de minerais" height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png>', rows[4], false, 0); str += '<TR><TD><BR></td></tr>'; row = []; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); row[i] = rp[1]; } str += _row ('<img height=18 title="Production de nourriture a l\'heure" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png>', row, false, 0); row = []; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); row[i] = rp[2]; } str += _row ('<img height=18 title="Production de bois a l\'heure" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png>', row, false, 0); row = []; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); row[i] = rp[3]; } str += _row ('<img height=18 title="Production de pierre a l\'heure" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png>', row, false, 0); row = []; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); row[i] = rp[4]; } str += _row ('<img height=18 title="Production de minerais a l\'heure" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png>', row, false, 0); str += '<TR><TD><font size=1><BR></td></tr>'; row = []; var totalbouffe = 0; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var usage = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; } str += _row ('Prod', row, false, 0); for(i=0; i<Cities.numCities; i++) { if (row[i] >= 0) row[i] = '----'; else { var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-row[i]) * 3600; if (timeLeft > 86313600) row[i] = '----'; else { if (Options.enableFoodWarn && timeLeft<(Options.foodWarnHours*3600)) row[i] = '<SPAN class=whiteOnRed>'+ timestrShort(timeLeft) +'</span>'; else row[i] = timestrShort(timeLeft); } } } str += _row ('Aut.', row, true, 0); str += '<TR><TD><font size=1><BR></td></tr>'; for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } if (Options.includeMarching){ for (var i=0; i<13; i++) rows[i][Cities.numCities] = march.marchUnits[i]; } str += "</table>"; myBO.Overview.cont.innerHTML = str; } catch (e){ myBO.Overview.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } t.displayTimer = setTimeout (t.show, 5000); }, }; myBO.Crests = { cont : null, state : null, init : function (div){ var t = myBO.Crests; this.cont = document.createElement('div'); //t.cont.innerHTML = '<DIV id=crestsContent style="maxheight:365px; height:365px; overflow-y:auto">'; return t.cont; }, getContent : function (){ var t = myBO.Crests; return t.cont; }, hide : function (){ var t = myBO.Crests; }, show : function (){ var t = myBO.Crests; // mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 350 + 'px' var bor,ector,kay,bedivere,gawain,percival,galahad,lancelot,arthur,morgana,mordred; if (Seed.items.i1101){bor=Seed.items.i1101}else{bor=0}; if (Seed.items.i1102){ector=Seed.items.i1102}else{ector=0}; if (Seed.items.i1103){kay=Seed.items.i1103}else{kay=0}; if (Seed.items.i1104){bedivere=Seed.items.i1104}else{bedivere=0}; if (Seed.items.i1105){gawain=Seed.items.i1105}else{gawain=0}; if (Seed.items.i1106){percival=Seed.items.i1106}else{percival=0}; if (Seed.items.i1107){galahad=Seed.items.i1107}else{galahad=0}; if (Seed.items.i1108){lancelot=Seed.items.i1108}else{lancelot=0}; if (Seed.items.i1109){arthur=Seed.items.i1109}else{arthur=0}; if (Seed.items.i1110){morgana=Seed.items.i1110}else{morgana=0}; if (Seed.items.i1111){mordred=Seed.items.i1111}else{mordred=0}; if (Seed.items.i1112){Stag=Seed.items.i1112}else{Stag=0}; if (Seed.items.i1113){Pendragon=Seed.items.i1113}else{Pendragon=0}; if (Seed.items.i1114){Lady=Seed.items.i1114}else{Lady=0}; if (Cities.cities[1]){ville2="#99EE99";}else{ville2="#EE9999";} if (Cities.cities[2]){ville3="#99EE99";}else{ville3="#EE9999";} if (Cities.cities[3]){ville4="#99EE99";}else{ville4="#EE9999";} if (Cities.cities[4]){ville5="#99EE99";}else{ville5="#EE9999";} if (Cities.cities[5]){ville6="#99EE99";}else{ville6="#EE9999";} if (Cities.cities[6]){ville7="#99EE99";}else{ville7="#EE9999";} if (t.state == null){ var m = '<style>\ CAPTION.MYTABLE\ {\ background-color:eeffff;\ color:black;\ border-style:solid;\ border-width:1px;\ border-color:black;\ }\ TABLE.MYTABLE\ { \ font-family:arial;\ border-collapse:collapse;\ font-size:10pt;\ background-color:F5F5F5;\ width:100%;\ border-style:solid;\ border-color:black;\ border-width:1px;\ }\ \ TH.MYTABLE\ {\ font-size:10pt;\ color:black;\ text-align:center;\ border-style:solid;\ border-color:black;\ border-width:1px;\ }\ \ \ TR.MYTABLE\ { \ }\ \ TD.MYTABLE\ { \ font-size:10pt;\ background-color:FFFFE5;\ color:black;\ border-style:solid;\ border-width:1px;\ text-align:left;\ }\ </style>\ \ <TABLE CLASS="MYTABLE" CELLPADDING=0 CELLSPACING=0>\ <CAPTION CLASS="MYTABLE">Les armoiries nécessaires pour les villes</CAPTION>\ \ <THEAD >\ <TR CLASS="MYTABLE">\ <TH CLASS="MYTABLE">Ville</TH>\ <TH CLASS="MYTABLE">Besoins 1</TH>\ <TH CLASS="MYTABLE">Besoins 2</TH>\ <TH CLASS="MYTABLE">Besoins 3</TH>\ </TR>\ </THEAD>\ \ <TBODY>\ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville2+';">Ville 2</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ville2+';">Niveau 7 ('+Seed.player.title+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ville2+';">10 Amis</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ville2+';"> </TD>\ </TR>\ \ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville3+';">Ville 3</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ ( (bor>=4)?"#99EE99":ville3 ) +';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1101.jpg> 4 Bor ('+bor+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ ( (ector>=2)?"#99EE99":ville3 ) +';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1102.jpg> 2 Ector ('+ector+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+ ( (kay>=1)?"#99EE99":ville3 ) +';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1103.jpg> 1 Kay ('+kay+')</TD>\ </TR>\ \ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville4+';">Ville 4</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (kay>=4)?"#99EE99":ville4 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1103.jpg> 4 Kay ('+kay+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (bedivere>=3)?"#99EE99":ville4 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1104.jpg> 3 Bedivere ('+bedivere+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (gawain>=1)?"#99EE99":ville4 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1105.jpg> 1 Gawain ('+gawain+')</TD>\ </TR>\ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville5+';">Ville 5</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (percival>=4)?"#99EE99":ville5 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1106.jpg> 4 Perceval ('+percival+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (galahad>=3)?"#99EE99":ville5 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1107.jpg> 3 Galaad ('+galahad+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (lancelot>=2)?"#99EE99":ville5 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1108.jpg> 2 Lancelot ('+lancelot+')</TD>\ </TR>\ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville6+';">Ville 6</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (arthur>=4)?"#99EE99":ville6 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1109.jpg> 4 Roi Arthur ('+arthur+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (morgana>=3)?"#99EE99":ville6 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1110.jpg> 3 Morgane ('+morgana+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (mordred>=2)?"#99EE99":ville6 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1111.jpg> 2 Mordred ('+mordred+')</TD>\ </TR>\ <TR CLASS="MYTABLE"> \ <TD CLASS="MYTABLE" style="background-color:'+ville7+';">Ville 7</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (Stag>=4)?"#99EE99":ville7 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1112.jpg> 4 Roi Stag ('+Stag+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (Pendragon>=3)?"#99EE99":ville7 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1113.jpg> 3 Terrestre ('+Pendragon+')</TD>\ <TD CLASS="MYTABLE" style="background-color:'+( (Lady>=2)?"#99EE99":ville7 )+';"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1114.jpg> 2 Aquatique ('+Lady+')</TD>\ </TR>\ </TBODY>\ </TABLE>\ <TABLE CLASS="MYTABLE" CELLPADDING=0 CELLSPACING=0>\ <CAPTION CLASS="MYTABLE">Vos armoiries en stock</CAPTION>\ <THEAD >\ <TR CLASS="MYTABLE">\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1101.jpg title="Bor"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1102.jpg title="Ector"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1103.jpg title="Kay"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1104.jpg title="Bedivere"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1105.jpg title="Gawain"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1106.jpg title="Perceval"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1107.jpg title="Galaad"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1108.jpg title="Lancelot"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1109.jpg title="Arthur"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1110.jpg title="Morgane"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1111.jpg title="Mordred"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1112.jpg title="Stag"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1113.jpg title="Terrestre"></TH>\ <TH CLASS="MYTABLE"><img width=25 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1114.jpg title="Aquatique"></TH>\ </TR>\ </THEAD>\ <TR CLASS="MYTABLE">\ <TD CLASS="MYTABLE"><center><b>'+bor+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+ector+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+kay+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+bedivere+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+gawain+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+percival+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+galahad+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+lancelot+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+arthur+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+morgana+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+mordred+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+Stag+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+Pendragon+'</TD>\ <TD CLASS="MYTABLE"><center><b>'+Lady+'</TD>\ </TR><TR CLASS="MYTABLE"></tr>\ </table>'; t.cont.innerHTML = m; t.state = 1; } }, } /*************************** STATISTIQUES ARMEE ***********************/ myBO.Overview1 = { cont : null, displayTimer : null, checkBox:null, checkBox1:null, Overview : function (){ }, init : function (){ this.cont = document.createElement('div'); return this.cont; }, getContent : function (){ return myBO.Overview1.cont; }, hide : function (){ clearTimeout (myBO.Overview1.displayTimer); }, show : function (){ var rownum = 0; var totalentre = 0; var t = myBO.Overview1; //mainPop2.div.style.width = 749 + 'px'; //mainPop2.div.style.height = 350 + 'px' clearTimeout (t.displayTimer); function UniteFormation(id) { var nbunit=0; // for(i=0; i<Cities.numCities; i++) { //alert(i); var cityIdd = Cities.cities[i].id; var q = Seed.queue_unt['city'+cityIdd]; var qs = q.toString(); if (q!=null && q.length>0 ){ for (var ii=0; ii<q.length; ii++){ if (q[ii][0]==id) nbunit+=parseInt(q[ii][1]); } } } totalentre += parseInt(nbunit*UniteCout(id)); return nbunit; } function UniteCout(id) { var Unitcout=unsafeWindow.unitupkeeps[id]; return Unitcout; } function _row (name, row, noTotal, typee){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push ('</td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += row[i]; m.push ('<TD style="background: #ffc">'); //if (Options.EnableFormation && typee>0) { // m.push (addCommas(tot+UniteFormation(typee))); //}else { if (tot<0) { m.push ("<SPAN class=class=boldRed>"+addCommas(tot)+"</span>"); } else { m.push (addCommas(tot)); } //} m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); m.push (addCommas(row[i])); m.push ('</td>'); } m.push ('</tr>'); return m.join(''); } try { dt = new Date (); dt.setTime (Seed.player.datejoinUnixTime * 1000); var now = unixTime(); str = "<TABLE class=ptTabLined cellspacing=0><TR valign=top align=right><TD width=65></td><TD width=88 style='background: #ffc'><B>TOTAL</b></td>"; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; Gate = parseInt(Seed.citystats[cityID].gate); if(Gate == 0) str += "<TD width=81 style='background-color:#77EE77'><B>"+ Cities.cities[i].name.substring(0,10) +'</b><BR></td>'; if(Gate != 0) str += "<TD width=81 style='background-color:#EE7777'><B>"+ Cities.cities[i].name.substring(0,10) +'</b><BR></td>'; } str += "<td></td></tr>"; rows = []; rows[0] = []; for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); if (Options.includeMarching){ for (k in Seed.queue_atkp[cityID]){ // each march march = Seed.queue_atkp[cityID][k]; if (typeof (march) == 'object'){ //for (ii=0; ii<13; ii++){ rows[r][i] += parseInt (march['unit'+ r +'Count']); //rows[r][i] += parseInt (march['unit'+ r +'Return']); //} } } } } } rownum = 0; this.totalentre = 0; for (r=1; r<13; r++){ str += _row ('<img height=18 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg>', rows[r],false, r); } var row = []; for(i=0; i<Cities.numCities; i++) { var totTime = 0; var q = Seed.queue_unt['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime < 3600) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('Form', row, true, 0); var row = []; for(i=0; i<Cities.numCities; i++) { var wall = {}; getWallInfo (Cities.cities[i].id, wall); var totTime = 0; var q = Seed.queue_fort['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime<1 && (wall.wallSpaceUsed < wall.wallSpace-4 || wall.fieldSpaceUsed < wall.fieldSpace-4)) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('Déf', row, true, 0); str += "</table>Marchants inclus"; myBO.Overview1.cont.innerHTML = str; } catch (e){ myBO.Overview1.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } t.displayTimer = setTimeout (t.show, 5000); }, }; /*************************** RESUME ***********************/ my.Overview = { cont : null, displayTimer : null, checkBox:null, checkBox1:null, Overview : function (){ }, init : function (){ this.cont = document.createElement('div'); return this.cont; }, getContent : function (){ return my.Overview.cont; }, hide : function (){ clearTimeout (my.Overview.displayTimer); }, show : function (){ var rownum = 0; var totalentre = 0; var t = my.Overview; clearTimeout (t.displayTimer); function clickEnableMarch (){ var t = my.Overview; if (checkBox.checked) Options.includeMarching = true; else Options.includeMarching = false; t.show (); } function clickEnableFormation (){ var t = my.Overview; if (checkBox1.checked) Options.EnableFormation = true; else Options.EnableFormation = false; t.show (); } function UniteFormation(id) { var nbunit=0; // for(i=0; i<Cities.numCities; i++) { //alert(i); var cityIdd = Cities.cities[i].id; var q = Seed.queue_unt['city'+cityIdd]; var qs = q.toString(); if (q!=null && q.length>0 ){ for (var ii=0; ii<q.length; ii++){ if (q[ii][0]==id) nbunit+=parseInt(q[ii][1]); } } } totalentre += parseInt(nbunit*UniteCout(id)); return nbunit; } function UniteCout(id) { var Unitcout=unsafeWindow.unitupkeeps[id]; return Unitcout; } function UniteKMG(nb) { if (Math.abs(nb)>1000000000) val="<span title='"+addCommas(nb)+"'>" + (nb/1000000000).toFixed(2) +" G</span>"; else if (Math.abs(nb)>1000000) val="<span title='"+addCommas(nb)+"'>" + (nb/1000000).toFixed(2) +" M</span>"; //else if (Math.abs(nb)>10000) // val="<span title='"+addCommas(nb)+"'>" + (nb/1000).toFixed(2) +" K</span>"; else if (nb==0) val="0"; else val=addCommas(nb); return val; } function _row (name, row, noTotal, typee){ if (rownum++ % 2) style = ''; else style = ' style = "background: #e8e8e8"'; var tot = 0; var m = []; m.push ('<TR style="background: #fff" align=right'); m.push (style); m.push ('><TD'); m.push (style); m.push ('><B>'); m.push (name); m.push ('</td>'); if (noTotal){ m.push ('<TD'); m.push (style); m.push ('> </td>'); } else { for (i=0; i<row.length; i++) tot += row[i]; m.push ('<TD style="background: #ffc">'); if (tot<0) { m.push ("<SPAN class=boldRed>"+UniteKMG(tot)+"</span>"); } else { if (typee>0 || !Options.EnableReduireUnit) m.push (addCommas(tot)); else m.push (UniteKMG(tot)); } m.push ('</td>'); } for (i=0; i<row.length; i++){ m.push ('<TD'); m.push (style); m.push ('>'); if (typee>0 || !Options.EnableReduireUnit) m.push (addCommas(row[i])); else m.push (UniteKMG(row[i])); m.push ('</td>'); } if (Options.EnableFormation && typee>0) { m.push ('<td>'+addCommas(UniteFormation(typee))+'</td>'); } if (Options.EnableFormation && name=='Form') { if (!Options.EnableReduireUnit) m.push("<td> </td><td>" + addCommas(totalentre) + "</td>"); else m.push("<td> </td><td>" + UniteKMG(totalentre) + "</td>"); } m.push ('</tr>'); return m.join(''); } //DebugTimer.start(); try { if (Options.includeMarching) march = getMarchInfo (); dt = new Date (); dt.setTime (Seed.player.datejoinUnixTime * 1000); str = '<div style="height:670px;max-height:670px;overflow-y:auto"><DIV class=ptstat style="margin-top:4px; margin-bottom:5px; "><TABLE cellspacing=0 cellpadding=0 class=ptTab width=97% align=center>\ <TR align=left><TD><SPAN class=ptStatLight>Entrée le :</span> '+ dt.toLocaleDateString() +'</td>\ <TD><SPAN class=ptStatLight>Puissance : </span> ' + addCommas(Seed.player.might) +'</td>\ <TD><SPAN class=ptStatLight>Alliance : </span> ' + getMyAlliance()[1] +'</td>\ <TD align=right><SPAN class=ptStatLight>Domain :</span> ' + unsafeWindow.domainName +'</td></tr></table></div><span id="debugtest"></span>'; str += "<DIV id=overMainDiv style='font-size:10px'><TABLE class=ptTabOverview cellpadding=0 cellspacing=0><TR align=center><TD width=55 align=center></td><TD width=88 style='background: #ffc; font-size:150%' align=center><SPAN class=oohfancy>Totals</SPAN></td>"; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; Gate = parseInt(Seed.citystats[cityID].gate); if(Gate == 0) var couleurr="#77EE77"; if(Gate != 0) var couleurr="#EE7777"; str += "<TD width=81 style='background-color:"+couleurr+"'><SPAN class=oohfancy>"+ Cities.cities[i].name.substring(0,10) +"</SPAN><BR><a href='javascript:void(0)' onclick='cm.utils.CoordinateLinkController.onClick(event)' class='coordinateLink'>("+Cities.cities[i].x +","+ Cities.cities[i].y+")</a><BR>"+ unsafeWindow.provincenames['p'+ Cities.cities[i].provId] +"</td>"; } if (Options.includeMarching) str += '<TD width=81><B>March.</b></td>'; if (Options.EnableFormation) str += "<TD width=81><B>Form.</b></td>"; str += "<td></td></tr>"; rows = []; rows[0] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[0][i] = parseInt(Seed.citystats[cityID].gold[0]); } for (r=1; r<5; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.resources[cityID]['rec'+r][0] / 3600); } } if (Options.includeMarching){ for (var i=0; i<5; i++) rows[i][Cities.numCities] = march.resources[i]; } str += _row ('<img height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/gold_30.png>', rows[0], false, 0); str += _row ('<img height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/food_30.png>', rows[1], false, 0); str += _row ('<img height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/wood_30.png>', rows[2], false, 0); str += _row ('<img height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/stone_30.png>', rows[3], false, 0); str += _row ('<img height=18 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/iron_30.png>', rows[4], false, 0); var now = unixTime(); str += '<TR><TD style="font-size:6px"><BR></font></td></tr>'; str +='<tr style="background: #fff" align=right><td><img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/131.jpg title="Batiment"></td><td> </td>'; for(i=0; i<Cities.numCities; i++) { var totTime = 0; if (Seed.queue_con["city" + Cities.cities[i].id].length > 0) { var q=Seed.queue_con["city" + Cities.cities[i].id][0]; var totTime = 0; totTime = q[4] - now; if (totTime < 0) totTime = 0; if (totTime < 3600) affuichage = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else affuichage = timestr(totTime); str +="<td>"+ affuichage + "</td>"; } else { str +="<td>0s</td>"; } } str +="</tr>"; // str +='<tr style="background: #e8e8e8" align=right><td><img height=20 src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/items/70/1.jpg title="Technologie"></b></td><td> </td>'; for(i=0; i<Cities.numCities; i++) { var totTime = 0; if (Seed.queue_tch["city" + Cities.cities[i].id].length > 0) { var q=Seed.queue_tch["city" + Cities.cities[i].id][0]; var totTime = 0; totTime = q[3] - now; if (totTime < 0) totTime = 0; if (totTime < 3600) affuichage = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else affuichage = timestr(totTime); str +="<td>"+ affuichage + "</td>"; } else { str +="<td>0s</td>"; } } str +="</tr>"; str += '<TR><TD style="font-size:6px"><BR></td></tr>'; row = []; var totalbouffe = 0; for(i=0; i<Cities.numCities; i++) { var rp = getResourceProduction (Cities.cities[i].id); var usage = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][3]); row[i] = rp[1] - usage; } str += _row ('Prod', row, false, 0); for(i=0; i<Cities.numCities; i++) { if (row[i] >= 0) row[i] = '----'; else { var timeLeft = parseInt(Seed.resources["city" + Cities.cities[i].id]['rec1'][0]) / 3600 / (0-row[i]) * 3600; if (timeLeft > 86313600) row[i] = '----'; else { if (Options.enableFoodWarn && timeLeft<(Options.foodWarnHours*3600)) row[i] = '<SPAN class=whiteOnRed><blink>'+ timestrShort(timeLeft) +'</blink></span>'; else row[i] = timestrShort(timeLeft); } } } str += _row ('Aut.', row, true, 0); str += '<TR><TD style="font-size:6px"><BR></td></tr>'; for (r=1; r<13; r++){ rows[r] = []; for(i=0; i<Cities.numCities; i++) { cityID = 'city'+ Cities.cities[i].id; rows[r][i] = parseInt(Seed.units[cityID]['unt'+r]); } } if (Options.includeMarching){ for (var i=0; i<13; i++) rows[i][Cities.numCities] = march.marchUnits[i]; } rownum = 0; this.totalentre = 0; for (r=1; r<13; r++){ str += _row ('<img height=18 title="'+unsafeWindow.unitcost['unt'+r][0]+'" src=http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/units/unit_'+r+'_30.jpg>', rows[r],false, r); } str += '<TR><TD style="font-size:6px"><BR></td></tr>'; var row = []; for(i=0; i<Cities.numCities; i++) { var totTime = 0; var q = Seed.queue_unt['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime < 3600) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('Form', row, true, 0); var row = []; for(i=0; i<Cities.numCities; i++) { var wall = {}; getWallInfo (Cities.cities[i].id, wall); var totTime = 0; var q = Seed.queue_fort['city'+Cities.cities[i].id]; if (q!=null && q.length>0) totTime = q[q.length-1][3] - now; if (totTime < 0) totTime = 0; if (totTime<1 && (wall.wallSpaceUsed < wall.wallSpace-4 || wall.fieldSpaceUsed < wall.fieldSpace-4)) row[i] = '<SPAN class=boldRed><B>'+ timestr(totTime) +'</b></span>'; else row[i] = timestr(totTime); } str += _row ('Déf', row, true, 0); str += '<TR><TD style="font-size:6px"><BR></td></tr>'; row = []; for(i=0; i<Cities.numCities; i++) { var totWilds = 0; dat = Seed.wilderness['city'+ Cities.cities[i].id]; if (dat!=null && matTypeof(dat)=='object') for (k in dat) ++totWilds; var nivcastle = parseInt(Seed.buildings['city'+ Cities.cities[i].id].pos0[1]); var castle = nivcastle; if (nivcastle==11) castle=12; if (nivcastle==12) castle=14; if (totWilds < castle) { row[i] = '<SPAN class=boldRed><B>'+ totWilds +'/'+ castle +'</b></span>'; }else{ row[i] = totWilds +'/'+ castle; } } str += _row ('TS', row, true, 0); row = []; var did = {}; for(i=0; i<Cities.numCities; i++) { totKnights = 0; dat = Seed.knights['city'+ Cities.cities[i].id]; for (k in dat) ++totKnights; var Knidispo = 0; var niveauPointRall=parseInt(getCityBuilding (Cities.cities[i].id, 12).maxLevel); for (var z=0; z<knightRoles.length; z++){ var leader = Seed.leaders['city'+Cities.cities[i].id][knightRoles[z][1]+'KnightId']; if (leader == 0) { }else{ did['knt'+leader] = true; } } for (k in Seed.knights['city'+Cities.cities[i].id]){ if (!did[k]) Knidispo++; } if (Knidispo<niveauPointRall) { row[i] = '<b>' + totKnights + '</b> - <span title="Chevalier dispo / Point de ralliement"><SPAN class=boldRed><B>'+Knidispo+'/' + niveauPointRall +'</span></span>'; }else { row[i] = '<b>' + totKnights + '</b> - <span title="Chevalier dispo / Point de ralliement">'+Knidispo+'/' + niveauPointRall +'</span>'; } } str += _row ('Chev', row, true, 0); str += '<TR><TD class=xtab></td><TD class=xtab colspan=4><INPUT type=CHECKBOX id=idCheck'+ (Options.includeMarching?' CHECKED':'') +'>Inclure les troupes et ressources marchants</td>\ <TD class=xtab colspan=4><INPUT type=CHECKBOX id=idCheck1'+ (Options.EnableFormation?' CHECKED':'') +'>Afficher les troupes en cours de formation</td></tr>'; str += "</table>"; my.Overview.cont.innerHTML = str +'</div>'; checkBox = document.getElementById('idCheck'); checkBox.addEventListener('click', clickEnableMarch, false); checkBox1 = document.getElementById('idCheck1'); checkBox1.addEventListener('click', clickEnableFormation, false); } catch (e){ my.Overview.cont.innerHTML = '<PRE>'+ e.name +' : '+ e.message +'</pre>'; } t.displayTimer = setTimeout (t.show, 5000); }, }; function getWallInfo (cityId, objOut){ objOut.wallSpaceUsed = 0; objOut.fieldSpaceUsed = 0; objOut.wallLevel = 0; objOut.wallSpace = 0; objOut.fieldSpace = 0; var b = Seed.buildings["city" + cityId]; if (b.pos1==null) return; objOut.wallLevel = parseInt(b.pos1[1]); var spots = 0; for (var i=1; i<(objOut.wallLevel+1); i++) spots += (i * 500); objOut.wallSpace = spots; objOut.fieldSpace = spots; var fort = Seed.fortifications["city" + cityId]; for (k in fort){ var id = parseInt(k.substr(4)); if (id<60) objOut.wallSpaceUsed += parseInt(unsafeWindow.fortstats["unt"+ id][5]) * parseInt(fort[k]); else objOut.fieldSpaceUsed += parseInt(unsafeWindow.fortstats["unt"+ id][5]) * parseInt(fort[k]); } } /*************************************** MARCHES ************************************************/ my.Marches = { cont:null, displayTimer:null, curTabBut : null, curTabName : null, state : null, getContent : function (){ return this.cont; }, hide : function (){ var t = my.Marches; document.getElementById('BoptMarchOutput').innerHTML=""; clearTimeout (t.displayTimer); }, init : function (){ this.cont = document.createElement('div'); return this.cont; }, setEnable : function (tf){ var t = my.Marches; clearInterval (t.reportTimer); if (tf){ t.reportTimer = setInterval (function(){my.Marches.getBattleReports(1);}, 5*1000); } }, fetchReportCB : function (rptNum, rslt){ var t = my.Marches; if (!rslt) return; if (rptNum < 0) { return; } var rptid = t.rptList.shift();//TBD verify matching rptHead. //Find the march, if it still exists, and update it. //Verify that the report data returned matches the march. var elem = t.marchData.shift(); var rptHead = elem.report; var theCity = ''; var theIndex = ''; var march; for(ii=0; ii<Cities.numCities; ii++) { cityId = 'city'+ Cities.cities[ii].id; for (kk in Seed.queue_atkp[cityId]){ march = Seed.queue_atkp[cityId][kk]; if (typeof (march) == 'object'){ if (rptHead.side0XCoord==march.toXCoord && (Math.abs(parseInt(rptHead.reportUnixTime)-parseInt(march.destinationUnixTime)) < 30) && rptHead.side0YCoord==march.toYCoord && rslt.s1Kid == march.knightId && march.marchType == rptHead.marchType ) { theCity = cityId; theIndex = kk; //if ( (Math.abs(parseInt(rptHead.reportUnixTime)-parseInt(march.destinationUnixTime)) >= 15) ) } } } } if (theCity != '') { march = Seed.queue_atkp[theCity][theIndex]; march.toCityId = rptHead.side0CityId;//So correct target type can be displayed. if (march.marchType==3) { t.scoutingReports.push( {'rptHead':rptHead,'report':rslt});//For scouting } if (march.marchType!=3) { march.gold = rslt.loot[0]; march.resource1 = rslt.loot[1]; march.resource2 = rslt.loot[2]; march.resource3 = rslt.loot[3]; march.resource4 = rslt.loot[4]; //if ( t.resources(march) == 0 ) //march.gold = -1;//Need a way to show that nothing was looted. var rptkeys = unsafeWindow.Object.keys(rslt.fght.s1); for (var key = 0; key < rptkeys.length; key++) { switch ( rptkeys[key]) { case 'u1': march.unit1Return = rslt.fght.s1.u1[1]; break; case 'u2': march.unit2Return = rslt.fght.s1.u2[1]; break; case 'u3': march.unit3Return = rslt.fght.s1.u3[1]; break; case 'u4': march.unit4Return = rslt.fght.s1.u4[1]; break; case 'u5': march.unit5Return = rslt.fght.s1.u5[1]; break; case 'u6': march.unit6Return = rslt.fght.s1.u6[1]; break; case 'u7': march.unit7Return = rslt.fght.s1.u7[1]; break; case 'u8': march.unit8Return = rslt.fght.s1.u8[1]; break; case 'u9': march.unit9Return = rslt.fght.s1.u9[1]; break; case 'u10': march.unit10Return = rslt.fght.s1.u10[1]; break; case 'u11': march.unit11Return = rslt.fght.s1.u11[1]; break; case 'u12': march.unit12Return = rslt.fght.s1.u12[1]; break; }; } } } if (t.rptList.length) setTimeout (function(){my.Marches.fetchReport(0);},1500); }, fetchReport : function (rptNum){ var t = my.Marches; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); if (!t.rptList.length) return; if (t.rptList.length-1 < rptNum) return; var rptid = t.rptList[rptNum]; params.rid = rptid; params.side = 1; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fetchReport.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { my.Marches.fetchReportCB(rptNum, rslt); }, onFailure: function (rslt) { my.Marches.fetchReportCB(-1, rslt); }, }); }, rptList:[], scoutingReports:[], returningTroops : function (march) { var t = my.Marches; if (!march) return 0; var sum = 0; sum += parseInt(march.unit1Return); sum += parseInt(march.unit2Return); sum += parseInt(march.unit3Return); sum += parseInt(march.unit4Return); sum += parseInt(march.unit5Return); sum += parseInt(march.unit6Return); sum += parseInt(march.unit7Return); sum += parseInt(march.unit8Return); sum += parseInt(march.unit9Return); sum += parseInt(march.unit10Return); sum += parseInt(march.unit11Return); sum += parseInt(march.unit12Return); return sum; }, resources : function (march) { var t = my.Marches; if (!march) return 0; var sum = 0; sum += parseInt(march.gold); sum += parseInt(march.resource1); sum += parseInt(march.resource2); sum += parseInt(march.resource3); sum += parseInt(march.resource4); //logit ("resources "+sum); return sum; }, needUpdate : function (march) { var t = my.Marches; if (!march) return false; var result = false; var now = unixTime(); var eta = parseInt(march.destinationUnixTime)-parseInt(now); if (t.resources(march) == 0 && eta < 0 ) result = true; return result; }, updateMarches : function () { var t = my.Marches; var result = false; for(var ii=0; ii<Cities.numCities; ii++) { cityId = 'city'+ Cities.cities[ii].id; for (var kk in Seed.queue_atkp[cityId]){ march = Seed.queue_atkp[cityId][kk]; if (typeof (march) == 'object'){ if ( t.needUpdate (march) ) return true; } } } return result; }, getBattleReports : function (pageNum){ var t = my.Marches; var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.pageNo = ''; if (pageNum && pageNum > 1) params.pageNo = pageNum; if (!t.updateMarches()) { //logit("BattleReports: No update needed."); return; } var page = pageNum+''; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/listReports.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { t.getBattleReportsCB (pageNum,rslt); }, onFailure: function (rslt) { t.getBattleReportsCB (pageNum,rslt); }, }, false); }, matchReport : function (report) { //return the march, or null var t = my.Marches; for(var c=0; c<Cities.numCities; c++) { cityId = 'city'+ Cities.cities[c].id; for (var k in Seed.queue_atkp[cityId]){ march = Seed.queue_atkp[cityId][k]; if (typeof (march) == 'object'){ //march.destinationUnixTime, report.reportUnixTime: The time should be close. if (report.side0XCoord==march.toXCoord && report.side0YCoord==march.toYCoord //&& (Math.abs(parseInt(report.reportUnixTime)-parseInt(march.destinationUnixTime)) < 15) ) { var result = march; return result; } } } } return ''; }, marchData:[], getBattleReportsCB : function (page, rslt){ var t = my.Marches; var pageNum = page; if (rslt) { if (!rslt.ok) { return; } if (rslt.arReports) { if (page == 1) t.matchCount=0; var ar = rslt.arReports; var rptkeys = unsafeWindow.Object.keys(ar); for (var j = 0; j < rptkeys.length; j++) { var rpt = ar[rptkeys[j]]; //If not fetched if (parseInt(rpt.reportStatus) == 2) { var march = my.Marches.matchReport (rpt); if (march != '') { t.matchCount++; t.marchData.push({'report':rpt}); t.rptList.push(rpt.reportId); } } } } setTimeout (function(){my.Marches.fetchReport(0);},1500); } }, handleUpdate : function() { var t = my.Marches; t.getBattleReports(1); }, show : function (){ var t = my.Marches; unsafeWindow.pr58Recall = t.ajaxRecall; unsafeWindow.BOraid_delete = t.ajaxDeleteRaid; unsafeWindow.r8x6Home = t.butSendHome; unsafeWindow.pr57Recall = t.butRecall2; t.setEnable(Options.forceMarchUpdate); // gère la couleur du bouton var atkclass=''; if(Seed && Seed.queue_atkinc) { for(k in Seed.queue_atkinc){ m = Seed.queue_atkinc[k]; if (m.marchType == 4){ atkclass = 'style="background-color:#FF9999;"'; } } } t.cont.innerHTML = '<TABLE class=ptTab align=center><TR><TD><INPUT class=bopbSubtab ID=BoptmrchSubM type=submit value="Marches en cours"></td>\ <TD><INPUT class=bopbSubtab ID=BoptmrchSubA type=submit '+atkclass+' value="Attaques Entrantes"></td>\ <TD><INPUT class=bopbSubtab ID=BoptmrchSubR type=submit value="Renforts Recus"></td>\ <TD><INPUT class=bopbSubtab ID=BoptmrchSubZ type=submit value="Renforts Envoyés"></td></tr></table>\ <DIV id="BoptMarchOutput" style="margin-top:5px; background-color:white; height:630px;max-height:630px;overflow-y:auto"></div>'; t.marchDiv = document.getElementById('BoptMarchOutput'); document.getElementById('BoptmrchSubA').addEventListener('click', e_butSubtab, false); document.getElementById('BoptmrchSubR').addEventListener('click', e_butSubtab, false); document.getElementById('BoptmrchSubM').addEventListener('click', e_butSubtab, false); document.getElementById('BoptmrchSubZ').addEventListener('click', e_butSubtab, false); if (atkclass!='') { changeSubtab (document.getElementById('BoptmrchSubA')); }else { changeSubtab (document.getElementById('BoptmrchSubM')); } function e_butSubtab (evt){ changeSubtab (evt.target); } function changeSubtab (but){ if (but == t.curTabBut) return; if (t.curTabBut){ t.curTabBut.className='bopbSubtab'; t.curTabBut.disabled=false; } t.curTabBut = but; but.className='bopbSubtab bopbSubtabSel'; but.disabled=true; t.curTabName = but.id.substr(11); t.show2(); } }, show2 : function (){ var t = my.Marches; t.state = null; clearTimeout (t.displayTimer); if (t.curTabName == 'Z') t.showReinforcementsOut(); else if (t.curTabName == 'R') t.showReinforcements(); else if (t.curTabName == 'M') t.showMarches(9); else t.showAttacks(); }, /*** ATTACKS SUBTAB ***/ showAttacks : function (){ var t = my.Marches; clearTimeout (t.displayTimer); var now = unixTime(); var target, atkType, who, atkclass; t.marchDiv.innerHTML = "<br>Chargement...<br><i></i>"; var s = '<table border=0 cellspacing=0 cellpadding=0 width=100%><tr class=ptstat><td class=ptstat><font color=#F77>Liste des attaques en cours :</td><td class=ptstat><select id="BoFiltreAttack"><option value="0">Tout voir</option></select></td><td class=ptstat><input type=button value="?" onclick="alert(\'Jaune = Eclaireur - Orange = Attaque 1 unite - Rouge = Attaque en nombre \');"></font></td></table>'; s += '<STYLE> .eclkk{background:#ffff55;} .attackkk{background:#ff5555;} .attackkA{background:#ff9955;}</style>'; s += '<TABLE border=0 cellspacing=0 cellpadding=2 width=100%>'; s += '<tr><td width=55><b>Temps</td><td width=60><b>Déf</td><td width=140 colspan=2><b>Lieu d\'attaque</td><td width=150 colspan=2><b>Qui m\'attaque !</td><td width=35><b>Dist</td><td width=25><b>Chev</td><td><b>Troupes</td></tr>'; var at=0; if(Seed && Seed.queue_atkinc) { var sortem = []; for (var k in Seed.queue_atkinc) sortem.push (Seed.queue_atkinc[k]); sortem.sort (function (a,b){ var x; if ((x = a.arrivalTime-b.arrivalTime)!=0) return x; return b.arrivalTime-a.arrivalTime; }); //for(k in Seed.queue_atkinc){ // m = Seed.queue_atkinc[k]; for (i=0; i<sortem.length; i++){ var m = sortem[i]; if (m.marchType == 3){ atkType = 'Eclaireur'; atkclass = 'eclkk'; } else if (m.marchType == 4){ atkType = 'Attaque'; atkclass = 'attackkk'; var nbtroupe=0; for (k in m.unts){ nbtroupe += parseInt(m.unts[k]); } if (nbtroupe==1) { atkclass = 'attackkA'; } } else { atkType ="?";//return; atkclass = ''; } if (atkclass !='') { // Seulement les vraies attaques ! at++; s += '<tr align=left >'; var arrivedans = unsafeWindow.timestr(parseInt(m.arrivalTime - unixTime())); //s += '<td class="'+atkclass+'">' + atkType + '</td>'; s += '<td class="'+atkclass+'">' + arrivedans +'</td>'; var couelur=""; var city = Cities.byID[m.toCityId]; if (city.tileId == m.toTileId) { target = '<a onclick="citysel_click(document.getElementById(\'citysel_'+ (city.idx+1)+'\'));">'+ city.name.substring(0,10) +'</a>'; cityID = 'city'+ m.toCityId; Gate = parseInt(Seed.citystats[cityID].gate); if(Gate == 0) { bouttt = '<input type=button value="DEF OFF" id="but_'+m.toCityId+'" style="background-color:#00AA00;padding:2px;border:1px solid yellow;">'; } else { bouttt = '<input type=button value="DEF ON" id="but_'+m.toCityId+'" style="background-color:red;">'; } coordos = '<a class="coordinateLink" onclick="cm.uuntstils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">('+ city.x + ',' + city.y +')</a>'; } else { target = 'TS'; bouttt=''; for (k in Seed.wilderness['city'+m.toCityId]){ if (Seed.wilderness['city'+m.toCityId][k].tileId == m.toTileId){ coordos = '<a class="coordinateLink" onclick="cm.utils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">('+Seed.wilderness['city'+m.toCityId][k].xCoord + ',' + Seed.wilderness['city'+m.toCityId][k].yCoord+')</a>'; break; } } } s += '<td class="'+atkclass+'" align=center>'+bouttt+'</td><td class="'+atkclass+'" align=center><b>' + target + '<td class="'+atkclass+'" align=center>'+coordos+'</b></td>'; if (Seed.players['u'+m.pid]) { who = '<span>'+Seed.players['u'+m.pid].n +'<br>'+addCommas(Seed.players['u'+m.pid].m)+'</span>'; } else if (m.players && m.players['u'+m.pid]) { who = m.players['u'+m.pid].n; } else{ who = 'Inconnu'; } if (m.fromXCoord) { who += '</td><td class="'+atkclass+'"><a class="coordinateLink" onclick="cm.utils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">(' + m.fromXCoord +','+ m.fromYCoord+')</a>'; } else { who += '</td><td class="'+atkclass+'">???</a></td>'; } s += '<td class="'+atkclass+'">' + who + '</td>'; if (m.fromXCoord) { s +='<td class="'+atkclass+'">'+ distance(city.x,city.y,m.fromXCoord,m.fromYCoord) +'</td>'; } else { s +='<td class="'+atkclass+'"> </td>'; } var troupe = ""; for (k in m.unts){ var uid = parseInt(k.substr (1)); troupe += m.unts[k] +' '+ unsafeWindow.unitcost['unt'+uid][0] +'<br>'; } var knh=' '; if (m.knt) { for (k in m.knt){ knh=parseInt(m.knt[k]); } } s += '<td class="'+atkclass+'">'+knh+'</td>'; s += '<td class="'+atkclass+'">' + troupe +'</td>'; s += '</tr>'; } // fin si attaque et eclaireur seulement } // fin du for if (at==0) { s ="<tr><colspan=4>Aucune attaque en cours...</td></tr>"; } } // fin de if s+='</table>'; t.marchDiv.innerHTML = s; for (var cityId in Cities.byID){ var but = document.getElementById ('but_'+ cityId); if (but) { //t.displayDefMode (cityId); addListener (but, cityId); } } function addListener (but, i){ but.addEventListener ('click', function (){t.butToggleDefMode(i)}, false); } t.displayTimer = setTimeout (t.showAttacks, 900); }, butToggleDefMode : function (cityId){ var t = my.Marches; var mode = 1; if (Seed.citystats["city" + cityId].gate != 0) mode = 0; t.ajaxSetDefMode (cityId, mode, function (newMode){ t.defMode[cityId] = newMode; t.displayDefMode (cityId); }); }, displayDefMode : function (cityId){ var t = my.Marches; var but = document.getElementById('but'+ cityId); if (t.defMode[cityId]){ but.style.backgroundColor = 'red'; } else { but.style.backgroundColor = '#00AA00'; } }, ajaxSetDefMode : function (cityId, state, notify){ var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.state = state; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/gate.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { Seed.citystats["city" + cityId].gate = state; notify (state); } }, onFailure: function () { } }) }, /*** MARCHES SUBTAB ***/ showMarches : function (numville){ var t = my.Marches; var rownum = 0; var now = unixTime(); var names = ['Ravi', 'Mili', 'Eclai', 'Piqu', 'Pala', 'Arch', 'Cav', 'CavL', 'Wago', 'Bali', 'Beli', 'Cata']; var t = my.Marches; clearTimeout (t.displayTimer); if (t.state == null){ var s = '<div class=ptstat>Liste des troupes marchantes (Retire le Raid :<input id=BOVoirRaid type=checkbox '+ (!Options.voirRaid?'':' CHECKED ') +'>)</div>'; s += '<STYLE> .tot{background:#f0e0f8;} .city{background:#ffffaa;}</style><input style="font-size:12px" type=button id="9_BOVilleBouton" value="0">'; for (var c=0; c<Cities.numCities; c++){ s += '<input style="font-size:12px" type=button id="'+ c +'_BOVilleBouton" value="' + (parseInt(c)+1) + ' : '+ Cities.cities[c].name.substring(0,10) +'">'; } s += '<div id="showMarchDiv"></div>'; t.marchDiv.innerHTML = s; document.getElementById('BOVoirRaid').addEventListener('click', function() { Options.voirRaid = document.getElementById('BOVoirRaid').checked; saveOptions(); }, false); document.getElementById("9_BOVilleBouton").addEventListener('click', function(){ var t = my.Marches; clearTimeout (t.displayTimer); t.showMarches(this.id.substring(0,1)); }, false); for (var c=0; c<Cities.numCities; c++){ document.getElementById(c + "_BOVilleBouton").addEventListener('click', function(){ var t = my.Marches; clearTimeout (t.displayTimer); t.showMarches(this.id.substring(0,1)); }, false); } t.state = 1; } s = '<TABLE cellspacing=0 cellpadding=2 width=100%>'; tot = []; for (i=0; i<13; i++) tot[i] = 0; var c = numville; // si c=9 alors on affiche toute les villes if (numville==9) { for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='object') { var a=0; for (k in que) { march = que[k]; if ((march.marchType!=2 && !Options.voirRaid) || (march.marchType!=9 && march.marchType!=2 && Options.voirRaid) ) { /// Marche Type \\ 2= Défense / 3= Eclaireur / 4= Attaque a++; if (a==1) { var cityID = 'city'+ Cities.cities[c].id; var slots=0; for(var z in Seed.queue_atkp[cityID]) slots++; var niveauPointRall=parseInt(getCityBuilding (Cities.cities[c].id, 12).maxLevel); // 12=Point de ralliement s+= '<TR><TD class="city">PR : '+slots+' / '+niveauPointRall+'</td><TD class="city" colspan=19 align=center><font size=3><B><i><u>Ville ' + (parseInt(c)+1) + ' : '+ Cities.cities[c].name +'</b></td></tr>'; } var mid = k.substr(1); knight = ''; if (Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"] !=0){ for (i in Seed.knights['city'+ Cities.cities[c].id]) { if (i == ("knt" + Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"]) ) knight = '' +Seed.knights['city'+ Cities.cities[c].id][i]["combat"] +''; } } else knight = ''; var playerId = march.toPlayerId; var cityId = march.toCityId; var tileType = parseInt(march.toTileType); var tileLevel = march.toTileLevel; var who = 'Inconnu'; if (Seed.players['u' + playerId]) { who = Seed.players['u' + playerId].n; } if (march.marchType==1) { // si transport c'est forcement sur une ville lol var player = "<span>Ville Niv "+ tileLevel +"</span>"; }else { var player = "<span title='Le jeu Bug !! Chier - F5 et cela corrige le pb....'>Barb Niv "+ tileLevel +"</span>"; } var tileNames = ['Barbares', 'Prairie', 'Lac', 'Bois', 'Collines', 'Montagne', 'Plaine', 'Ville']; var numtile= (tileType/10) + 1; if (tileType==10) numtile=1; if (tileType==11) numtile=2; if (tileType <= 50) { // TS player = tileNames[numtile] +" Niv " + tileLevel; /*if (playerId==0) { player += " - Libre"; } else { player += " - " + who; }*/ // BUG DU JEU !!! pfff } if (tileType == 51 && playerId == 0) { // Barbares player = "Barb Niv " + tileLevel; } var nomville=""; if (playerId > 0 && tileType == 51) { // ville if (march.marchType==1) { for(i=0; i<Cities.numCities; i++) { if (cityId==Cities.cities[i].id) { nomville=Cities.cities[i].name break; } } player = 'Votre ville '+ nomville; } else { player = 'Ville Niv ' + tileLevel; } } var typeattack="?"; if (march.marchType==3) typeattack='Eclaireur'; if (march.marchType==4) typeattack='Attaque'; if (march.marchType==1) typeattack='Transport'; if (march.marchType==5) typeattack='Réassigne'; if (march.marchType==9) typeattack='Raid attaque'; var now = new Date(); var statusm = march.marchStatus; var Marchstatut="<span title='type : "+march.marchType+" Status : "+statusm+"'>?</span> "; var arrivedans="0s"; var arrivedanssec=0; if (statusm==1) { Marchstatut=""; if (march.marchType==3) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg" align=absmiddle>'; if (march.marchType==4) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg" align=absmiddle>'; if (march.marchType==9) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg" align=absmiddle>'; if (march.marchType==1) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg" align=absmiddle>'; if (march.marchType==5) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle>'; Marchstatut+=" Marchant"; arrivedans = unsafeWindow.timestr(parseInt(march.destinationUnixTime - unixTime())); arrivedanssec = parseInt(march.destinationUnixTime - unixTime()); } if (statusm==8) { Marchstatut = '<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg" align=absmiddle> Retour'; arrivedans = unsafeWindow.timestr(march.returnUnixTime - unixTime()); arrivedanssec = parseInt(march.returnUnixTime - unixTime()); } if (statusm==2) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> Campement'; } if (statusm==5) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> Rapport'; } if (statusm==4) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_resting.png" align=absmiddle> Déchargement'; } if (statusm==3) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_stopped_desat.png" align=absmiddle> Arretée'; } s += '<TR align=left><td align=left width=10%>'; if (march.marchType!=9 && statusm==1 && arrivedanssec>60) s +='<A class=button20 onclick="pr58Recall('+ mid+','+Cities.cities[c].id+')"><SPAN>Rappeler</span></a>'; if (march.marchType!=9 && statusm==2) s +='<A class=button20 onclick="attack_recall('+ mid+', 1, '+Cities.cities[c].id+');"><span>Rappeler</span></a>'; if (march.marchType==9 && statusm==3 && arrivedanssec>60) s +='<A class=button20 onclick="BOraid_delete('+ mid+','+Cities.cities[c].id+');return false;"><span>Supprimer</span></a>'; s +='</td><td align=left width=10%>'+typeattack+'</td><td>'+arrivedans+'</td><td align=left width=15%>' + Marchstatut +'</td>\ <TD align=left width=15%>' + player + '</td><td><a class="coordinateLink" onclick="cm.utils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">(' + march.toXCoord +','+ march.toYCoord +')</a></td><td>' + knight +' </td><td colspan=12>' for (i=1; i<13; i++) { if (statusm==8) { if (parseInt (march['unit'+ i +'Return']) > 0) { s += names[i-1]+" :" + parseInt (march['unit'+ i +'Return']) + "<br>"; tot[i] += parseInt (march['unit'+ i +'Return']); } } else { if (parseInt (march['unit'+ i +'Count']) > 0) { s += names[i-1]+" :" + parseInt (march['unit'+ i +'Count']) + "<br>"; tot[i] += parseInt (march['unit'+ i +'Count']); } } } s += '</td><td style="font-size:11px">'; //if (statusm==8) { // seulement le retour pour les barbares // s += 'Or : ' + addCommas(parseInt (march['gold'])) + '<br>Nourriture : ' + addCommas(march['resource1']) + '<br>Bois : ' + addCommas(march['resource2']) + '<br>Pierre : ' + addCommas(march['resource3']) + '<br>Minerais : ' + addCommas(march['resource4']) + '</td>'; //} else { if (march.marchType!=9) { s += '<a class=button20 onclick="view_march('+ mid+');return false;";><span>Détail</psan></a></td>'; }else { s+='</td>'; } //} s += '</tr>'; // Bouton détail : <td><a class=button20 onclick="view_march('+ mid+');return false;";><span>Détail</psan></a></td> }// fin de MarchType !=2 (renfort) } // fin k march //} else { // s= '<br>Aucune marche en cours...'; } // in test Object } //fin de ville s += '<TR><TD colspan=20><BR><BR></td></tr></table><TABLE cellspacing=0 cellpadding=2 width=100%><tr><td colspan=1></td>'; for (k=0; k<names.length; k++) s += '<TD width=7% align=center><B>' + names[k] + '</b></td>'; s += '</tr>'; s += '<TR align=center><TD class="tot" align=left width=10%><B>TOTAUX</b></td>'; for (i=1; i<13; i++) s+= '<TD class="tot">'+ tot[i] +'</td>'; s += '<td></td></tr></table>'; s += '<BR><BR><DIV style="font-size: 10px"></div>'; } else { /// ici c'est quand il y a une seule ville à montrer c!=99 var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='object') { var a=0; for (k in que){ march = que[k]; if ((march.marchType!=2 && !Options.voirRaid) || (march.marchType!=9 && march.marchType!=2 && Options.voirRaid) ) { /// Marche Type \\ 2= Défense / 3= Eclaireur / 4= Attaque a++; if (a==1) { //s+= '<TR><TD class=xtab><BR></td></tr>'; var cityID = 'city'+ Cities.cities[c].id; var slots=0; for(var z in Seed.queue_atkp[cityID]) slots++; var niveauPointRall=parseInt(getCityBuilding (Cities.cities[c].id, 12).maxLevel); // 12=Point de ralliement s+= '<TR><TD class="city">PR : '+slots+' / '+niveauPointRall+'</td><TD class="city" colspan=17 align=center><font size=3><B><i><u>Ville ' + (parseInt(c)+1) + ' : '+ Cities.cities[c].name +'</b></td></tr>'; } var mid = k.substr(1); knight = ''; //if (parseInt(march.knightCombat)>0) knight=' ('+ march.knightCombat +')'; if (Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"] !=0){ for (i in Seed.knights['city'+ Cities.cities[c].id]) { if (i == ("knt" + Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"]) ) knight = ' (Chev : ' +Seed.knights['city'+ Cities.cities[c].id][i]["combat"] +')'; } } else knight = ''; //if (march.toPlayerId) { var playerId = march.toPlayerId; //}else{ //var playerId = -1; //} var cityId = march.toCityId; var tileType = parseInt(march.toTileType); var tileLevel = march.toTileLevel; var who = 'Inconnu'; if (Seed.players['u' + playerId]) { who = Seed.players['u' + playerId].n; } if (march.marchType==1) { // si transport c'est forcement sur une ville lol var player = "<span>Ville Niv "+ tileLevel +"</span>"; }else { var player = "<span title='Le jeu Bug !! Chier - F5 et cela corrige le pb....'>Ville ou Barbares Niv "+ tileLevel +"</span>"; } var tileNames = ['Camps barbares', 'Prairie', 'Lac', 'Bois', 'Collines', 'Montagne', 'Plaine', 'Ville']; var numtile= (tileType/10) + 1; if (tileType==10) numtile=1; if (tileType==11) numtile=2; if (tileType <= 50) { // TS player = tileNames[numtile] +" Niv " + tileLevel; /*if (playerId==0) { player += " - Libre"; } else { player += " - " + who; }*/ // BUG DU JEU !!! pfff } if (tileType == 51 && playerId == 0) { // Barbares player = "Camps Barbares Niveau " + tileLevel; } var nomville=""; if (playerId > 0 && tileType == 51) { // ville if (march.marchType==1) { for(i=0; i<Cities.numCities; i++) { if (cityId==Cities.cities[i].id) { nomville=Cities.cities[i].name break; } } player = 'Votre ville '+ nomville; } else { player = 'Ville Niv ' + tileLevel; } } //player += "<br>playerId:"+ playerId + "<br>tileType:" + tileType + "<br>tileLevel:" + tileLevel + "<br>cityId:" + cityId; var typeattack="?"; if (march.marchType==3) typeattack='Eclaireur'; if (march.marchType==4) typeattack='Attaquer'; if (march.marchType==1) typeattack='Transporte'; if (march.marchType==5) typeattack='Réassigner'; if (march.marchType==9) typeattack='Raid attaque'; var now = new Date(); var statusm = march.marchStatus; var Marchstatut="? "; var arrivedans="0s"; if (statusm==1) { Marchstatut=""; if (march.marchType==3) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/scouting.jpg" align=absmiddle>'; if (march.marchType==4) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg" align=absmiddle>'; if (march.marchType==9) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/attacking.jpg" align=absmiddle>'; if (march.marchType==1) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/transporting.jpg" align=absmiddle>'; if (march.marchType==5) Marchstatut+='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle>'; Marchstatut+=" Marchant"; arrivedans = unsafeWindow.timestr(parseInt(march.destinationUnixTime - unixTime())); } if (statusm==8) { Marchstatut = '<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg" align=absmiddle> Retour'; arrivedans = unsafeWindow.timestr(march.returnUnixTime - unixTime()); } if (statusm==2) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> Campement'; } if (statusm==5) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> En attente Rapport'; } if (statusm==4) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_resting.png" align=absmiddle> Déchargement'; } if (statusm==3) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/autoAttack/raid_stopped_desat.png" align=absmiddle> Arretée'; } couleur=""; if (statusm==8) { if (parseInt (march['unit'+ i +'Return']) > 0) { var dif=parseInt(march['unit'+ i +'Count']) - parseInt(march['unit'+ i +'Return']); if(dif>0) { couleur="style='background-colo:#EF9999"; } }else { var dif=parseInt(march['unit'+ i +'Count']) - 0; if(dif>0) { couleur="style='background-colo:#EF9999"; } } } s += '<TR align=left '+couleur+'><td align=left width=10% '+couleur+'>'; if (march.marchType!=9 && statusm==1) s +='<A class=button20 onclick="pr58Recall('+ mid+')"><SPAN>Rappeler</span></a>'; if (march.marchType!=9 && statusm==2) s +='<A class=button20 onclick="attack_recall('+ mid+', 1, '+Cities.cities[c].id+')"><span>Rappeler</span></a>'; if (march.marchType==9 && statusm==3) s +='<A class=button20 onclick="BOraid_delete('+ mid+','+Cities.cities[c].id+');return false;"><span>Supprimer</span></a>'; s +=' </td><td align=left width=10%>'+typeattack+'</td><td>'+arrivedans+'</td><td align=left width=15%>' + Marchstatut +'</td>\ <TD align=left width=25%>' + player + ' <a class="coordinateLink" onclick="cm.utils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">(' + march.toXCoord +','+ march.toYCoord +')</a> ' + knight +' </td><td colspan=12 '+couleur+'>' for (i=1; i<13; i++) { if (statusm==8) { if (parseInt (march['unit'+ i +'Return']) > 0) { s += names[i-1]+" :" + parseInt (march['unit'+ i +'Return']) + "<br>"; tot[i] += parseInt (march['unit'+ i +'Return']); } } else { if (parseInt (march['unit'+ i +'Count']) > 0) { s += names[i-1]+" :" + parseInt (march['unit'+ i +'Count']) + "<br>"; tot[i] += parseInt (march['unit'+ i +'Count']); } } } s += '</td><td style="font-size:11px">'; if (statusm==8) { // seulement le retour pour les barbares s += 'Or : ' + addCommas(parseInt (march['gold'])) + '<br>Nourriture : ' + addCommas(march['resource1']) + '<br>Bois : ' + addCommas(march['resource2']) + '<br>Pierre : ' + addCommas(march['resource3']) + '<br>Minerais : ' + addCommas(march['resource4']) + '</td>'; } else { if (march.marchType!=9) { s += '<a class=button20 onclick="view_march('+ mid+');return false;";><span>Détail</span></a></td>'; }else { s+='</td>'; } } s += '</tr>'; }// fin de MarchType } // fin k in que s += '<TR><TD colspan=18><BR><BR></td></tr></table><TABLE cellspacing=0 cellpadding=2 width=100%><tr><td colspan=1></td>'; for (k=0; k<names.length; k++) s += '<TD width=7% align=center><B>' + names[k] + '</b></td>'; s += '</tr>'; s += '<TR align=center><TD class="tot" align=left width=10%><B>TOTAUX</b></td>'; for (i=1; i<13; i++) s+= '<TD class="tot">'+ tot[i] +'</td>'; s += '<td></td></tr></table>'; s += '<BR><BR><DIV style="font-size: 10px"></div>'; } else { s= '<br>Aucune marche en cours...'; } } // Fin c=99 document.getElementById('showMarchDiv').innerHTML = s; t.displayTimer = setTimeout (function() { t.showMarches(numville); }, 1000); }, ajaxDeleteRaid: function(marchId, cityId) { var villeencours=cityId; var march = Seed.queue_atkp["city" + villeencours]["m" + marchId]; if (march == null){ alert("Marche non trouve"); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.action="deleteMarch"; params.marchId = marchId; params.ctrl="BotManager"; params.settings={cityId:villeencours}; unsafeWindow.ajax.Request(unsafeWindow.g_ajaxpath+"ajax/_dispatch.php"+unsafeWindow.g_ajaxsuffix,{method:"post",parameters:params,loading:true, onSuccess:function(transport) { var m = eval("(" + transport.responseText + ")"); if (m.ok){ var j=marchId; var t=cityId; var n=Seed.units["city"+t]; for(var o=0;o<13;++o){ if (m["unit"+o+"Return"]) { var p=parseInt(m["unit"+o+"Return"]); if(!isNaN(p)&&(p>0)){ n["unt"+o]=parseInt(n["unt"+o])+p; } } } unsafeWindow.cityinfo_army(); var s="city"+t; // recherche de mon chevalier var mymarch = unsafeWindow.seed.queue_atkp["city" + t]["m" + j]; var kngId= mymarch.knightId; delete Seed.queue_atkp[s]["m"+j]; if(unsafeWindow.Object.keys(Seed.queue_atkp[s]).length==0){ Seed.queue_atkp[s]=[]; } Seed.knights["city"+t]["knt"+kngId].knightStatus=1; } else { } }, onFailure: function () { }, }); }, /*** REINFORCEMENTS SUBTAB ***/ showReinforcementsOut : function (){ var rownum = 0; var names = ['Ravi', 'Mili', 'Eclai', 'Piqu', 'Pala', 'Arch', 'Cav', 'CavL', 'Wago', 'Bali', 'Beli', 'Cata']; var t = my.Marches; clearTimeout (t.displayTimer); // TODO FIX: Troops show as encamped even if they are here yet (check destinationUnixTime) var s = '<div class=ptstat>Liste des troupes envoyées en renforts</div>'; s += '<STYLE> .tot{background:#f0e0f8;} .city{background:#ffffaa;}</style>'; s += '<TABLE cellspacing=0 cellpadding=2 width=100%>'; tot = []; for (i=0; i<13; i++) tot[i] = 0; for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; var a=0; for (k in que){ march = que[k]; if (march.marchType==2) { /// Marche Type \\ 2= Défense / 3= Eclaireur / 4= Attaque a++; if (a==1) { s+= '<TR><TD class="city" colspan=16 align=left><B>Ville ' + (parseInt(c)+1) + ' : '+ Cities.cities[c].name +'</b></td></tr>'; } var mid = k.substr(1); knight = ''; if (Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"] !=0){ for (i in Seed.knights['city'+ Cities.cities[c].id]) { if (i == ("knt" + Seed.queue_atkp['city'+ Cities.cities[c].id][k]["knightId"]) ) knight = '' +Seed.knights['city'+ Cities.cities[c].id][i]["combat"] +''; } } else knight = ''; if (parseInt(march.knightCombat)>0) knight=' ('+ march.knightCombat +')'; try { player = Seed.players['u'+march.toPlayerId].n; //Seed.players['u'+k].n; } catch (err){ player = 'Inconnu'; } s += '<TR align=left><td align=left width=12%>'; var statusm = march.marchStatus; var Marchstatut=''; var arrivedans="0s"; var arrivedanssec=0; if (statusm==1) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> Marchant'; arrivedans = unsafeWindow.timestr(parseInt(march.destinationUnixTime - unixTime())); arrivedanssec = parseInt(march.destinationUnixTime - unixTime()); } if (statusm==2) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> Campement'; } if (statusm==8) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/returning.jpg" align=absmiddle> Retour'; arrivedans = unsafeWindow.timestr(parseInt(march.returnUnixTime - unixTime())); arrivedanssec = parseInt(march.returnUnixTime - unixTime()); } if (statusm==5) { Marchstatut='<img src="http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/reinforce.jpg" align=absmiddle> En attente Rapport'; } if (statusm==1 && arrivedanssec>60){ s +='<A class=button20 onclick="pr58Recall('+ mid+','+Cities.cities[c].id+')"><SPAN>Rappeler</span></a>'; } if (statusm==2) { s +='<A class=button20 onclick="pr57Recall('+ mid+')"><SPAN>Rappeler</span></a>'; } else { s += ' '; } s+='</td><td align=left width=15%>'+Marchstatut+'</td><td>'+arrivedans+'</td><TD align=left width=30%>' + player + ' <a class="coordinateLink" onclick="cm.utils.CoordinateLinkController.onClick(event)" href="javascript:void(0)">(' + march.toXCoord +','+ march.toYCoord +')</a> ' + knight +' </td><td colspan=12>' for (i=1; i<13; i++) { if (statusm==8) { if (parseInt (march['unit'+ i +'Return']) > 0) { s += " " + parseInt (march['unit'+ i +'Return']) + " "+names[i-1]+"<br>"; tot[i] += parseInt (march['unit'+ i +'Return']); } } else { if (parseInt (march['unit'+ i +'Count']) > 0) { s += " " + parseInt (march['unit'+ i +'Count']) + " "+names[i-1]+"<br>"; tot[i] += parseInt (march['unit'+ i +'Count']); } } } s += '</td></tr>'; }// fin de MarchType } } s += '<TR><TD colspan=16><BR><BR></td></tr></table><TABLE cellspacing=0 cellpadding=2 width=100%><tr><td colspan=1></td>'; for (k=0; k<names.length; k++) s += '<TD width=7% align=center><B>' + names[k] + '</b></td>'; s += '</tr>'; s += '<TR align=center><TD class="tot" align=left width=10%><B>TOTAUX</b></td>'; for (i=1; i<13; i++) s+= '<TD class="tot">'+ tot[i] +'</td>'; s += '</tr></table>'; t.marchDiv.innerHTML = s; t.displayTimer = setTimeout (t.show2, 1000); return; }, showReinforcements : function (){ var rownum = 0; var names = ['Ravi', 'Mili', 'Eclai', 'Piqu', 'Pala', 'Arch', 'Cav', 'CavL', 'Wago', 'Bali', 'Beli', 'Cata']; var t = my.Marches; clearTimeout (t.displayTimer); function clickShowRemaining (){ checkBox = document.getElementById('idCheck2'); if (checkBox.checked) Options.encRemaining = false; else Options.encRemaining = true; t.show2 (); } enc = {}; numSlots = 0; if (matTypeof(Seed.queue_atkinc) != 'array'){ for (k in Seed.queue_atkinc){ march = Seed.queue_atkinc[k]; if (march.marchType == 2){ ++numSlots; city = march.toCityId; from = march.fromPlayerId; if (!enc[city]) enc[city] = {}; if (!enc[city][from]) enc[city][from] = []; s = {}; s.knight = parseInt (march.knightCombat); s.marchId = k.substr(1); s.fromXCoord = march.fromXCoord; s.fromYCoord = march.fromYCoord; s.troops = []; for (i=1; i<13; i++){ if (Options.encRemaining) s.troops[i] = parseInt (march['unit'+ i +'Return']); else s.troops[i] = parseInt (march['unit'+ i +'Count']); } enc[city][from].push (s); } } } s = '<div class=ptstat>Liste des troupes en renfort dans vos ambassades.</div>'; if (numSlots == 0){ s += '<BR><CENTER><B>Aucunes troupes en renfort actuellement.</b></center>'; } else { s += '<STYLE> .tot{background:#f0e0f8;} .city{background:#ffffaa;} .entete{background:#efa9a9;}</style>'; s += '<TABLE cellspacing=0 cellpadding=2 width=100%>\ <tr><td class="entete">Actions</td><td class="entete">Coordonnées</td><td class="entete">Envoyé par</td><td class="entete">Chevalier</td><td colspan=12 class="entete">Unités</td><td class="entete">Entretien</td></tr>'; tot = []; totent= 0; for (i=0; i<13; i++) { tot[i] = 0; } for (c in Cities.cities){ dest = Cities.cities[c].id; if (enc[dest]){ s+= '<TR><TD class="city" colspan=17 align=left><B>Ville ' + (parseInt(c)+1) + ' : '+ Cities.cities[c].name +'</b></td></tr>'; for (p in enc[dest]){ try { player = Seed.players['u'+p].n; } catch (err){ player = '???'; } for (m=0; m<enc[dest][p].length; m++){ var march = enc[dest][p][m]; knight = ''; if (march.knight > 0) knight = ' '+ march.knight +''; // TODO: Only allow 'send home' if troops are here now (marchStatus = ?) s += '<TR align=left><td align=left width=12%><A class=button20 onclick="r8x6Home('+ march.marchId +')"><SPAN>Renvoyer</span></a></td>\ <TD align=left><a href="javascript:void(0)" onclick="cm.utils.CoordinateLinkController.onClick(event)" class="coordinateLink">('+march.fromXCoord+','+march.fromYCoord+')'+'</a></td>\ <TD align=left width=25%>'+ player +' </td><td align=left>'+ knight+'</td><td colspan=12>' var g=0; for (i=1; i<13; i++){ if (march.troops[i] > 0) { s += ''+ march.troops[i] +' '+ names[i-1] +'<br>'; } tot[i] += march.troops[i]; g+=parseInt(march.troops[i])*parseInt(unsafeWindow.unitupkeeps[i]); } totent += g; s += '</td><td>'; s += addCommas(g) + '</td></tr>'; } } } } s += '<TR><TD colspan=17><BR><BR></td></tr></table><TABLE cellspacing=0 cellpadding=2 width=100%><tr><td colspan=1></td>'; for (k=0; k<names.length; k++) s += '<TD width=7% align=center><B>' + names[k] + '</b></td>'; s += '</tr>'; s += '<TR align=center><TD class="tot" align=left width=10% rowspan=2><B>TOTAUX</b></td>'; for (i=1; i<13; i++) s+= '<TD class="tot">'+ tot[i] +'</td>'; s += '</tr><td colspan=12>Consommation : '+addCommas(totent)+' nourriture / h</td></table>'; } s += '<BR><BR><INPUT type=CHECKBOX id=idCheck2 '+ (Options.encRemaining?'':' CHECKED ') +'> Show Original Troops'; s += '<BR><BR><DIV style="font-size: 10px">NOTE : Vous devez rafraichir KOC pour voir les nouveaux renforts chez vous.</div>'; t.marchDiv.innerHTML = s; checkBox = document.getElementById('idCheck2'); checkBox.addEventListener('click', clickShowRemaining, false); t.displayTimer = setTimeout (t.show2, 10000); }, butSendHome : function (marchId){ var t = my.Marches; //logit ("SEND HOME: "+ marchId); t.ajaxSendHome (marchId, function(r){t.show(); }); }, ajaxSendHome : function (marchId, notify){ var march = Seed.queue_atkinc['m'+ marchId]; if (march == null){ notify ('March not found!'); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.mid = marchId; params.cid = march.toCityId; params.fromUid = march.fromPlayerId; params.fromCid = march.fromCityId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/kickoutReinforcements.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ var upkeep = 0; for (var i=1; i<13; i++) upkeep += parseInt(march["unit" + i + "Return"]) * parseInt(unsafeWindow.unitupkeeps[i]); unsafeWindow.seed.resources["city"+ march.toCityId].rec1[3] -= upkeep; if (parseInt(march.fromPlayerId) == parseInt(unsafeWindow.tvuid)) { var mymarch = unsafeWindow.seed.queue_atkp["city" + march.fromCityId]["m" + marchId]; var marchtime = Math.abs(parseInt(mymarch.destinationUnixTime) - parseInt(mymarch.eventUnixTime)); mymarch.returnUnixTime = unixTime() + marchtime; mymarch.marchStatus = 8; } delete unsafeWindow.seed.queue_atkinc["m" + marchId]; if (notify != null) notify(null); } else { if (notify != null) notify(rslt.errorMsg); } }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); }, butRecall2 : function (marchId){ var t = my.Marches; t.ajaxRecall2 (marchId); }, ajaxRecall2 : function (marchId, notify){ // rappele de troupes en défence chez allié var villeencours; for (var c=0; c<Cities.numCities; c++){ var que = Seed.queue_atkp['city'+ Cities.cities[c].id]; if (matTypeof(que)=='array') continue; for (k in que){ if (k == 'm'+marchId){ villeencours = Cities.cities[c].id; break; } } } var march = Seed.queue_atkp["city" + villeencours]["m" + marchId]; if (march == null){ //notify ('March not found!'); alert("Marche non trouve"); return; } var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.mid = marchId; params.cid = villeencours; //march.toCityId; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/undefend.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ var mymarch = unsafeWindow.seed.queue_atkp["city" + villeencours]["m" + marchId]; var marchtime = Math.abs(parseInt(mymarch.destinationUnixTime) - parseInt(mymarch.eventUnixTime)); mymarch.returnUnixTime = unixTime() + marchtime; mymarch.marchStatus = 8; } else { } }, onFailure: function () { }, }); }, ajaxRecall : function (marchId, cid, notify){ // rappel des troupe en cours de marches var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.mid = marchId; params.cid = cid; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/cancelMarch.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok){ if(rslt.updateSeed){ unsafeWindow.seed.queue_atkp["city"+params.cid]["m"+params.mid].marchStatus=8; var marchtime=parseInt(unsafeWindow.seed.queue_atkp["city"+params.cid]["m"+params.mid].returnUnixTime)-parseInt(unsafeWindow.seed.queue_atkp["city"+params.cid]["m"+params.mid].destinationUnixTime); var ut=unsafeWindow.unixtime(); if(unsafeWindow.seed.playerEffects.returnExpire>unsafeWindow.unixtime()){marchtime*=0.5} unsafeWindow.seed.queue_atkp["city"+cid]["m"+marchId].destinationUnixTime=rslt.destinationUnixTime||ut; unsafeWindow.seed.queue_atkp["city"+cid]["m"+marchId].returnUnixTime=rslt.returnUnixTime||ut+marchtime*rslt.returnMultiplier; unsafeWindow.seed.queue_atkp["city"+cid]["m"+marchId].marchStatus=8; unsafeWindow.update_seed(rslt.updateSeed); } for(var j=1;j<13;j++){ unsafeWindow.seed.queue_atkp["city"+cid]["m"+marchId]["unit"+j+"Return"]=parseInt(unsafeWindow.seed.queue_atkp["city"+cid]["m"+marchId]["unit"+j+"Count"]) } } }, onFailure: function () { }, }); }, }; // TODO: Handle multiple instances altering same function!! var CalterUwFunc = function (funcName, findReplace) { var t = this; this.isEnabled = false; this.isAvailable = isAvailable; this.setEnable = setEnable; this.funcOld = null; this.funcNew = null; try { var x = funcName.split('.'); var f = unsafeWindow; for (var i=0; i<x.length; i++) f = f[x[i]]; this.funcOld = f; var rt = f.toString().replace ('function '+ funcName, 'function'); for (var i=0; i<findReplace.length; i++){ x = rt.replace(findReplace[i][0], findReplace[i][1]); if (x == rt) // if not found return; rt = x; } this.funcNew = rt; } catch (err) { } function setEnable (tf){ if (t.funcNew == null) return; if (t.isEnabled != tf){ if (tf){ var scr = document.createElement('script'); // <== need to remove on disable!!! scr.innerHTML = funcName +' = '+ t.funcNew; document.body.appendChild(scr); setTimeout ( function (){document.body.removeChild(scr);}, 500); t.isEnabled = true; } else { var x = funcName.split('.'); var f = unsafeWindow; for (var i=0; i<x.length-1; i++) f = f[x[i]]; f[x[x.length-1]] = this.funcOld; t.isEnabled = false; } } } function isAvailable (){ if (t.funcNew == null) return false; return true; } }; var WarnZeroAttack = { modalAttackFunc : null, init : function (){ var t = WarnZeroAttack; t.modalAttackFunc = new CalterUwFunc ('modal_attack', [['modal_attack_check()', 'modalAttack_hook()']]); unsafeWindow.modalAttack_hook = t.hook; t.modalAttackFunc.setEnable(true); }, enable : function (tf){ var t = WarnZeroAttack; t.modalAttackFunc.setEnable (tf); }, isAvailable : function (){ var t = WarnZeroAttack; return t.modalAttackFunc.isAvailable(); }, hook : function (){ var t = WarnZeroAttack; if (parseIntZero(document.getElementById('modal_attack_target_coords_x').value) == 0 && parseIntZero(document.getElementById('modal_attack_target_coords_y').value) == 0){ alert('IMPOSSIBLE DE PARTIR SUR LES COORDONNEES 0,0 !'); } else { unsafeWindow.modal_attack_check(); } }, } function distance (d, f, c, e) { var a = 750; var g = a / 2; var b = Math.abs(c - d); if (b > g) b = a - b; var h = Math.abs(e - f); if (h > g) h = a - h; return Math.round(100 * Math.sqrt(b * b + h * h)) / 100; }; var MapDistanceFix = { popSlotsFunc : null, init : function (){ var t = MapDistanceFix; t.popSlotsFunc = new CalterUwFunc ('MapObject.prototype.populateSlots', [['this.distance', 'fixMapDistance_hook']]); if (t.popSlotsFunc.isAvailable()){ unsafeWindow.fixMapDistance_hook = t.fixMapDistance_hook; if (Options.fixMapDistance) t.enable (true); } }, fixMapDistance_hook : function (cityX, cityY, tileX, tileY){ var city = Cities.byID[unsafeWindow.currentcityid]; return distance (city.x, city.y, tileX, tileY); }, enable : function (tf){ var t = MapDistanceFix; t.popSlotsFunc.setEnable (tf); }, isAvailable : function (){ var t = MapDistanceFix; return t.popSlotsFunc.isAvailable(); }, } function setTabStyle (e, selected){ if (selected){ e.className = 'matTabSel'; } else { e.className = 'matTabNotSel'; } } function clickedTab (e){ who = e.target.id.substring(2); newObj = my[who]; currentObj = my[currentName]; if (currentName != who){ setTabStyle (document.getElementById ('aa'+currentName), false); setTabStyle (document.getElementById ('aa'+who), true); if (currentObj){ currentObj.hide (); currentObj.getContent().style.display = 'none'; } currentName = who; Options.currentTab = currentName; cont = newObj.getContent(); newObj.getContent().style.display = 'block'; } newObj.show(); } function clickedTab2 (e){ who2 = e.target.id.substring(3); newObj2 = myBO[who2]; currentObj2 = myBO[currentName2]; if (currentName2 != who2){ setTabStyle (document.getElementById ('ab'+currentName2), false); setTabStyle (document.getElementById ('ab'+who2), true); if (currentObj2){ currentObj2.hide (); currentObj2.getContent().style.display = 'none'; } currentName2 = who2; Options.currentTab2 = currentName2; cont = newObj2.getContent(); newObj2.getContent().style.display = 'block'; } newObj2.show(); } function mouseMainTab (me){ if (me.button == 2){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); mainPop.setLocation ({x: c.x+4, y: c.y+c.height}); } } function mouseMainTab2 (me){ if (me.button == 2){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); mainPop2.setLocation ({x: c.x+4, y: c.y+c.height}); } } function eventHideShow (){ if (mainPop.toggleHide(mainPop)){ my[currentName].show(); Options.ptWinIsOpen = true; } else { my[currentName].hide(); Options.ptWinIsOpen = false; } saveOptions(); } function eventHideShow2 (){ if (mainPop2.toggleHide(mainPop2)){ myBO[currentName2].show(); Options.ptWin2IsOpen = true; } else { myBO[currentName2].hide(); Options.ptWin2IsOpen = false; } saveOptions(); } function hideMe (){ mainPop.show (false); my[currentName].hide(); Options.ptWinIsOpen = false; saveOptions(); } function addMyFunction (func){ // add function to run in our own scope unsafeWindow[func.name] = func; } function getResearchLevels () { for (var t=1; t < 17; t++) { if (t != 7) { researchLevels[t] = {}; researchLevels[t].Id = t; researchLevels[t].Name = unsafeWindow.techcost['tch'+t][0].replace (/'/img, '\''); researchLevels[t].Level = parseInt(Seed.tech['tch'+t]); researchLevels[t].NextLevelETA = 0; } } var q; var now = unixTime(); for(var i=0; i<Cities.numCities; i++) { // each city var cityID = 'city'+ Cities.cities[i].id; q = Seed.queue_tch[cityID]; if (q[0] != undefined) researchLevels[parseInt(q[0][0])].NextLevelETA = parseInt(q[0][3]) - now; } } function getTroopDefTrainEstimates (cityID){ var b = Seed.buildings[cityID]; city.numBarracks = 0; city.maxBarracks = 0; city.totLevelsBarracks = 0; city.blacksmithLevel = 0; city.stableLevel = 0; city.workshopLevel = 0; city.wallLevel = 0; for (var j=1; j<33; j++){ if (b['pos'+j]) { var bname = parseInt(b['pos'+j][0]); var blvl = parseInt(b['pos'+j][1]); if (bname==13) { city.numBarracks++; city.totLevelsBarracks += parseInt(blvl); if (blvl>city.maxBarracks) city.maxBarracks=blvl; } if (bname==15) city.blacksmithLevel = blvl; if (bname==16) city.workshopLevel = blvl; if (bname==17) city.stableLevel = blvl; if (bname==19) city.wallLevel = blvl; } } var now = unixTime(); city.marshallCombatScore = 0; var s = Seed.knights[cityID]; if (s) { s = s["knt" + Seed.leaders[cityID].combatKnightId]; if (s){ city.marshallCombatScore = s.combat; if (s.combatBoostExpireUnixtime > now) city.marshallCombatScore *= 1.25; } } city.foremanBasePoliticsScore = 0; var s = Seed.knights[cityID]; if (s) { s = s["knt" + Seed.leaders[cityID].politicsKnightId]; if (s) { city.foremanBasePoliticsScore = s.politics; if (s.politicsBoostExpireUnixtime > now) city.foremanBasePoliticsScore *= 1.25; } } city.loggingLevel = parseInt(Seed.tech["tch2"]); city.geometryLevel = parseInt(Seed.tech["tch5"]); city.eagleEyesLevel = parseInt(Seed.tech["tch6"]); city.poisonedEdgeLevel = parseInt(Seed.tech["tch8"]); city.metalAlloysLevel = parseInt(Seed.tech["tch9"]); city.featherweightPowderLevel = parseInt(Seed.tech["tch10"]); city.alloyHorseshoesLevel = parseInt(Seed.tech["tch12"]); city.fletchingLevel = parseInt(Seed.tech["tch13"]); city.giantsStrengthLevel = parseInt(Seed.tech["tch16"]); var bm = city.numBarracks + 0.1 * (city.totLevelsBarracks - city.numBarracks); var mf = city.marshallCombatScore/200; var gf = city.geometryLevel/10; var sf = city.stableLevel/10; var wf = city.workshopLevel/10; var isf = bm * (1+mf+gf); var csf = bm * (1+mf+gf+sf); var ssf = bm * (1+mf+gf+sf+wf); var pf = city.foremanBasePoliticsScore/200; var gsf = city.giantsStrengthLevel/10; var dsf = 1+pf+gsf; city.Troop1Time = ((city.maxBarracks > 0)?(50/isf):0); city.Troop2Time = city.Troop1Time/2; city.Troop3Time = ((city.maxBarracks > 1 && city.eagleEyesLevel > 0)?(100/isf):0); city.Troop4Time = ((city.maxBarracks > 1 && city.poisonedEdgeLevel > 0)?(150/isf):0); city.Troop5Time = ((city.maxBarracks > 2 && city.blacksmithLevel > 0 && city.metalAlloysLevel > 0)?(225/isf):0); city.Troop6Time = ((city.maxBarracks > 3 && city.fletchingLevel > 0)?(350/isf):0); city.Troop7Time = ((city.maxBarracks > 4 && city.stableLevel > 0 && city.alloyHorseshoesLevel > 0)?(500/csf):0); city.Troop8Time = ((city.maxBarracks > 6 && city.blacksmithLevel > 4 && city.stableLevel > 4 && city.alloyHorseshoesLevel > 4)?(1500/csf):0); city.Troop9Time = ((city.maxBarracks > 5 && city.stableLevel > 0 && city.workshopLevel > 2 && city.featherweightPowderLevel > 0)?(1000/ssf):0); city.Troop10Time = ((city.maxBarracks > 7 && city.stableLevel > 1 && city.workshopLevel > 4 && city.geometryLevel > 4 && city.fletchingLevel > 5)?(3000/ssf):0); city.Troop11Time = ((city.maxBarracks > 8 && city.blacksmithLevel > 4 && city.stableLevel > 2 && city.workshopLevel > 6 && city.metalAlloysLevel > 7 && city.geometryLevel > 6)?(4500/ssf):0); city.Troop12Time = ((city.maxBarracks > 9 && city.stableLevel > 1 && city.workshopLevel > 8 && city.geometryLevel > 9 && city.fletchingLevel > 9)?(6000/ssf):0); city.Def53Time = ((city.wallLevel > 5 && city.blacksmithLevel > 5 && city.fletchingLevel > 4)?(180/dsf):0); city.Def55Time = ((city.wallLevel > 7 && city.blacksmithLevel > 7 && city.fletchingLevel > 6 && city.geometryLevel > 6)?(135/dsf):0); city.Def60Time = ((city.wallLevel > 3 && city.blacksmithLevel > 3 && city.poisonedEdgeLevel > 1)?(90/dsf):0); city.Def61Time = ((city.wallLevel > 0 && city.metalAlloysLevel > 0)?(30/dsf):0); city.Def62Time = ((city.wallLevel > 1 && city.blacksmithLevel > 1 && city.loggingLevel > 1)?(60/dsf):0); } function setCities(){ var il = unsafeWindow.itemlist; for (var i=1101; i < 1115; i++) crestname[i] = il['i'+i].name getResearchLevels(); Cities.numCities = Seed.cities.length; Cities.cities = []; Cities.byID = {}; for (i=0; i<Cities.numCities; i++){ city = {}; city.idx = i; city.id = parseInt(Seed.cities[i][0]); city.name = Seed.cities[i][1]; city.x = parseInt(Seed.cities[i][2]); city.y = parseInt(Seed.cities[i][3]); city.tileId = parseInt(Seed.cities[i][5]); city.provId = parseInt(Seed.cities[i][4]); getTroopDefTrainEstimates('city'+ city.id); Cities.cities[i] = city; Cities.byID[Seed.cities[i][0]] = city; } } function getCityIdFromXY(x, y) { for(var i=0; i<Cities.numCities; i++) { if (Cities.cities[i].x == x && Cities.cities[i].y == y) { return Cities.cities[i].id; } } return -1; } function officerId2String (oid){ if (oid==null) return ''; else if (oid==3) return unsafeWindow.allianceOfficerTypeMapping[3]; else if (oid==2) return unsafeWindow.allianceOfficerTypeMapping[2]; else if (oid==1) return unsafeWindow.allianceOfficerTypeMapping[1]; else if (oid==4) return unsafeWindow.allianceOfficerTypeMapping[4]; return ''; } // onClick (city{name, id, x, y}, x, y) city may be null! function CdispCityPicker (id, span, dispName, notify, selbut){ function CcityButHandler (t){ var that = t; this.clickedCityBut = clickedCityBut; function clickedCityBut (e){ if (that.selected != null) that.selected.className = "castleBut castleButNon"; that.city = Cities.cities[e.target.id.substr(that.prefixLen)]; if (that.dispName) document.getElementById(that.id+'cname').innerHTML = that.city.name; e.target.className = "castleBut castleButSel"; that.selected = e.target; if (that.coordBoxX){ that.coordBoxX.value = that.city.x; that.coordBoxY.value = that.city.y; that.coordBoxX.style.backgroundColor = '#ffffff'; that.coordBoxY.style.backgroundColor = '#ffffff'; } if (that.notify != null) that.notify(that.city, that.city.x, that.city.y); } } function selectBut (idx){ document.getElementById(this.id+'_'+idx).click(); } function bindToXYboxes (eX, eY){ function CboxHandler (t){ var that = t; this.eventChange = eventChange; if (that.city){ eX.value = that.city.x; eY.value = that.city.y; } function eventChange (){ var x = parseInt(that.coordBoxX.value, 10); var y = parseInt(that.coordBoxY.value, 10); if (isNaN(x) || x<0 || x>750){ that.coordBoxX.style.backgroundColor = '#ff8888'; return; } if (isNaN(y) || y<0 || y>750){ that.coordBoxY.style.backgroundColor = '#ff8888'; return; } that.coordBoxX.style.backgroundColor = '#ffffff'; that.coordBoxY.style.backgroundColor = '#ffffff'; if (that.notify != null) that.notify (null, x, y); } } this.coordBoxX = eX; this.coordBoxY = eY; var bh = new CboxHandler(this); eX.size=2; eX.maxLength=3; eY.size=2; eY.maxLength=3; eX.addEventListener('change', bh.eventChange, false); eY.addEventListener('change', bh.eventChange, false); } this.selectBut = selectBut; this.bindToXYboxes = bindToXYboxes; this.coordBoxX = null; this.coordBoxY = null; this.id = id; this.dispName = dispName; this.prefixLen = id.length+1; this.notify = notify; this.selected = null; this.city = null; var m = ''; for (var i=0; i<Cities.cities.length; i++) m += '<INPUT class="castleBut castleButNon" id="'+ id +'_'+ i +'" value="'+ (i+1) +'" type=submit \>'; if (dispName) m += ' <SPAN style="display:inline-block; width:85px; font-weight:bold;" id='+ id +'cname' +'></span>'; span.innerHTML = m; var handler = new CcityButHandler(this); for (var i=0; i<Cities.cities.length; i++) document.getElementById (id+'_'+i).addEventListener('click', handler.clickedCityBut, false); if (selbut != null) this.selectBut(selbut); } // TODO: make class (multiple instances needed) var pop = null; function dialogRetry (errMsg, seconds, onRetry, onCancel){ seconds = parseInt(seconds); if (pop == null) { pop = new CPopup ('BOptretry', 0, 0, 400,200, true); pop.getTopDiv().innerHTML = '<CENTER><b>Boite à outils</b></center>'; pop.getMainDiv().innerHTML = '<CENTER><BR><FONT COLOR=#550000><B>Une erreur a été détectée :</b></font><BR><BR><DIV id=BOparetryErrMsg></div>\ <BR><BR><B>Nouvel essai dans <SPAN id=BOparetrySeconds></b></span> secondes ...<BR><BR><INPUT id=BOparetryCancel type=submit value="ANNULER" \>'; document.getElementById('BOparetryCancel').addEventListener ('click', doCancel, false); } pop.show(true); pop.centerMe(mainPop.getMainDiv()); document.getElementById('BOparetryErrMsg').innerHTML = errMsg; document.getElementById('BOparetrySeconds').innerHTML = seconds; var rTimer = setTimeout (doRetry, seconds*1000); countdown (); function countdown (){ document.getElementById('BOparetrySeconds').innerHTML = seconds--; if (seconds > 0) cdTimer = setTimeout (countdown, 1000); } function doCancel(){ clearTimeout (rTimer); clearTimeout (cdTimer); pop.destroy(); onCancel (); } function doRetry (){ clearTimeout (rTimer); clearTimeout (cdTimer); pop.show(false); onRetry(); } } // emulate protoype's Ajax.Request ... function AjaxRequest (url, opts){ var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': '1.6.1', 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; var ajax = null; if (window.XMLHttpRequest) ajax=new XMLHttpRequest(); else ajax=new ActiveXObject("Microsoft.XMLHTTP"); if (opts.method==null || opts.method=='') method = 'GET'; else method = opts.method.toUpperCase(); if (method == 'POST'){ headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; } else if (method == 'GET'){ addUrlArgs (url, opts.parameters); } ajax.onreadystatechange = function(){ // ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4 if (ajax.readyState==4) { if (ajax.status >= 200 && ajax.status < 305) if (opts.onSuccess) opts.onSuccess(ajax); else if (opts.onFailure) opts.onFailure(ajax); } else { if (opts.onChange) opts.onChange (ajax); } } ajax.open(method, url, true); // always async! for (var k in headers) ajax.setRequestHeader (k, headers[k]); if (matTypeof(opts.requestHeaders)=='object') for (var k in opts.requestHeaders) ajax.setRequestHeader (k, opts.requestHeaders[k]); if (method == 'POST'){ var a = []; for (k in opts.parameters){ if(matTypeof(opts.parameters[k]) == 'object') for(var h in opts.parameters[k]) a.push (k+'['+h+'] ='+ opts.parameters[k][h] ); else a.push (k +'='+ opts.parameters[k] ); } ajax.send (a.join ('&')); } else { ajax.send(); } } function MyAjaxRequest (url, o, noRetryX){ if (DEBUG_TRACE) logit (" 0 myAjaxRequest: "+ url +"\n" + inspect (o, 2, 1)); var opts = unsafeWindow.Object.clone(o); var wasSuccess = o.onSuccess; var wasFailure = o.onFailure; var retry = 0; var delay = 5; var noRetry = noRetry===true?true:false; opts.onSuccess = mySuccess; opts.onFailure = myFailure; new AjaxRequest(url, opts); return; function myRetry(){ ++retry; new AjaxRequest(url, opts); delay = delay * 1.25; } function myFailure(){ var o = {}; o.ok = false; o.errorMsg = "AJAX Communication Failure"; wasFailure (o); } function mySuccess (msg){ var rslt = eval("(" + msg.responseText + ")"); var x; if (window.EmulateAjaxError){ rslt.ok = false; rslt.error_code=8; } if (rslt.ok){ if (rslt.updateSeed) unsafeWindow.update_seed(rslt.updateSeed); wasSuccess (rslt); return; } rslt.errorMsg = unsafeWindow.printLocalError((rslt.error_code || null), (rslt.msg || null), (rslt.feedback || null)); try { if ( (x = rslt.errorMsg.indexOf ('<br><br>')) > 0) rslt.errorMsg = rslt.errorMsg.substr (0, x-1); } catch(e) { rslt.errorMsg= "Erreur"; } if (!noRetry && (rslt.error_code==0 ||rslt.error_code==8 || rslt.error_code==1 || rslt.error_code==3)){ dialogRetry (rslt.errorMsg, delay, function(){myRetry()}, function(){wasSuccess (rslt)}); } else { wasSuccess (rslt); } } } // returns: 'neutral', 'friendly', or 'hostile' function getDiplomacy (aid) { if (Seed.allianceDiplomacies == null) return 'neutral'; if (Seed.allianceDiplomacies.friendly && Seed.allianceDiplomacies.friendly['a'+aid] != null) return 'friendly'; if (Seed.allianceDiplomacies.hostile && Seed.allianceDiplomacies.hostile['a'+aid] != null) return 'hostile'; return 'neutral'; }; function getMyAlliance (){ if (Seed.allianceDiplomacies==null || Seed.allianceDiplomacies.allianceName==null) return [0, 'None']; else return [Seed.allianceDiplomacies.allianceId, Seed.allianceDiplomacies.allianceName]; } function getDiplomacy2 (aid) { if (Seed.allianceDiplomacies == null) return 'Neutral'; if (Seed.allianceDiplomacies.friendly && Seed.allianceDiplomacies.friendly['a'+aid] != null) return 'Friendly'; if (Seed.allianceDiplomacies.hostile && Seed.allianceDiplomacies.hostile['a'+aid] != null) return 'Hostile'; if (aid == Seed.allianceDiplomacies.allianceId) return 'Ally'; return 'Neutral'; }; // TODO: Check times for expired marches !?!?! // note: unselected city has outdated info function getMarchInfo (){ var ret = {}; ret.marchUnits = []; ret.returnUnits = []; ret.resources = []; for (i=0; i<13; i++){ ret.marchUnits[i] = 0; ret.returnUnits[i] = 0; } for (i=0; i<5; i++){ ret.resources[i] = 0; } var now = unixTime(); for(i=0; i<Cities.numCities; i++) { // each city cityID = 'city'+ Cities.cities[i].id; for (k in Seed.queue_atkp[cityID]){ // each march march = Seed.queue_atkp[cityID][k]; if (typeof (march) == 'object'){ for (ii=0; ii<13; ii++){ ret.marchUnits[ii] += parseInt (march['unit'+ ii +'Count']); ret.returnUnits[ii] += parseInt (march['unit'+ ii +'Return']); } for (ii=1; ii<5; ii++){ ret.resources[ii] += parseInt (march['resource'+ ii]); } ret.resources[0] += parseInt (march['gold']); } // TODO: fixup completed marches // TODO: Assume transport is complete ? } } return ret; } var fortNamesShort = { 53: "Arbaletes", 55: "Trebuchet", 60: "Pieges", 61: "Chausse-trape", 62: "Palissade", } // returns {count, maxlevel} function getCityBuilding (cityId, buildingId){ var b = Seed.buildings['city'+cityId]; var ret = {count:0, maxLevel:0}; for (var i=1; i<33; i++){ if (b['pos'+i] && b['pos'+i][0] == buildingId){ ++ret.count; if (parseInt(b['pos'+i][1]) > ret.maxLevel) ret.maxLevel = parseInt(b['pos'+i][1]); } } return ret; } function logit (msg){ var serverID = getServerId(); var now = new Date(); GM_log (serverID +' @ '+ now.toTimeString().substring (0,8) +'.' + now.getMilliseconds() +': '+ msg); } /************ DEBUG WIN *************/ var debugWin = { popDebug : null, dbDefaultNot : 'tech,tutorial,items,quests,wilderness,wildDef,buildings,knights,allianceDiplomacies,appFriends,players', dbSelect : {}, doit : function (){ var t = debugWin; function syncBoxes (){ var div = document.getElementById('dbpoplist'); for (var i=0; i<div.childNodes.length; i++){ if (div.childNodes[i].type && div.childNodes[i].type=='checkbox'){ var name=div.childNodes[i].name.substr(6); div.childNodes[i].checked = t.dbSelect[name]; } } } function clickedAll (){ for (var k in t.dbSelect) t.dbSelect[k] = true; syncBoxes(); } function clickedNone (){ for (var k in t.dbSelect) t.dbSelect[k] = false; syncBoxes(); } function clickedDefaults (){ for (k in t.dbSelect) t.dbSelect[k] = true; var not = t.dbDefaultNot.split(','); for (var i=0; i<not.length; i++) t.dbSelect[not[i]] = false; syncBoxes(); } function clickedShow (){ var now = new Date(); var myseed = unsafeWindow.Object.clone (Seed); var div = document.getElementById('dbpoplist'); for (var i=0; i<div.childNodes.length; i++){ if (div.childNodes[i].type && div.childNodes[i].type=='checkbox'){ var name=div.childNodes[i].name.substr(6); if (!div.childNodes[i].checked) delete myseed[name]; } } WinLog.write ("seed @ "+ unixTime() +" ("+ now +")\n\n"+ inspect (myseed, 8, 1)); myseed=null; } function clickedShowScripts (){ var scripts = document.getElementsByTagName('script'); for (var i=0; i<scripts.length; i++){ if (scripts[i].src!=null && scripts[i].src!='') WinLog.write ('<A TARGET=_tab HREF="'+ scripts[i].src +'">'+ scripts[i].src +'</a>'); } } if (t.popDebug == null){ t.popDebug = new CPopup ('db', 0, 0, 400,500, true); t.popDebug.getTopDiv().innerHTML = 'DEBUG'; t.popDebug.getMainDiv().innerHTML = '<DIV><INPUT type=submit id=dbsuball value=ALL> <INPUT type=submit id=dbsubnone value=NONE> \ <INPUT type=submit id=dbdefaults value=DEFAULTS> <INPUT type=submit id=dbsubdo value=SHOW> <INPUT type=submit id=dbsubscripts value=SCRIPTS></div>\ <DIV id=dbpoplist style="max-height:400px; height:400px; overflow-y:auto"></div>'; var div = document.getElementById('dbpoplist'); for (var k in Seed) t.dbSelect[k] = true; var not = t.dbDefaultNot.split(','); for (var i=0; i<not.length; i++) t.dbSelect[not[i]] = false; var m = []; for (k in t.dbSelect){ m.push ('<INPUT type=checkbox '); m.push ('name="dbpop_'); m.push (k); m.push ('"> '); m.push (k); m.push ('<BR>'); } div.innerHTML = m.join (''); document.getElementById('dbsuball').addEventListener('click', clickedAll, false); document.getElementById('dbsubnone').addEventListener('click', clickedNone, false); document.getElementById('dbdefaults').addEventListener('click', clickedDefaults, false); document.getElementById('dbsubdo').addEventListener('click', clickedShow, false); document.getElementById('dbsubscripts').addEventListener('click', clickedShowScripts, false); syncBoxes(); } t.popDebug.show (true); }, } function saveOptions (){ var serverID = getServerId(); GM_setValue ('BOOptions_'+serverID, JSON2.stringify(Options)); } function readOptions (){ var serverID = getServerId(); s = GM_getValue ('BOOptions_'+serverID); if (s != null){ opts = JSON2.parse (s); for (k in opts) Options[k] = opts[k]; } } function createButton (label){ var a=document.createElement('a'); a.className='button20'; a.innerHTML='<span style="color: #ff6">'+ label +'</span>'; return a; } function AddMainTabLink(text, eventListener, mouseListener) { var a = createButton (text); a.className='tab'; a.id = 'ptBoite'; var tabs=document.getElementById('main_engagement_tabs'); if(!tabs) { tabs=document.getElementById('topnav_msg'); if (tabs) tabs=tabs.parentNode; } if(tabs) { var e = tabs.parentNode; var eNew = null; for (var i=0; i<e.childNodes.length; i++){ var ee = e.childNodes[i]; if (ee.tagName && ee.tagName=='DIV' && ee.className=='tabs_engagement' && ee.id!='main_engagement_tabs'){ eNew = ee; break; } } if (eNew == null){ eNew = document.createElement('div'); eNew.className='tabs_engagement'; eNew.style.background='#ca5'; tabs.parentNode.insertBefore (eNew, tabs); eNew.id = 'gmTabs'; eNew.style.whiteSpace='nowrap'; eNew.style.width='735px'; } if (eNew.firstChild){ eNew.insertBefore (a, eNew.firstChild); }else{ eNew.appendChild(a); } a.addEventListener('click',eventListener, false); if (mouseListener != null) a.addEventListener('mousedown',mouseListener, true); return a; } return null; } function AddMainTabLink2(text, eventListener, mouseListener) { var b = createButton (text); b.className='tab'; b.id = 'ptBoite2'; var tabs=document.getElementById('main_engagement_tabs'); if(!tabs) { tabs=document.getElementById('topnav_msg'); if (tabs) tabs=tabs.parentNode; } if(tabs) { var e = tabs.parentNode; var eNew = null; for (var i=0; i<e.childNodes.length; i++){ var ee = e.childNodes[i]; if (ee.tagName && ee.tagName=='DIV' && ee.className=='tabs_engagement' && ee.id!='main_engagement_tabs'){ eNew = ee; break; } } if (eNew == null){ eNew = document.createElement('div'); eNew.className='tabs_engagement'; eNew.style.background='#ca5'; tabs.parentNode.insertBefore (eNew, tabs); eNew.id = 'gmTabs'; eNew.style.whiteSpace='nowrap'; eNew.style.width='735px'; } if (eNew.firstChild){ eNew.insertBefore (b, eNew.firstChild); }else{ eNew.appendChild(b); } b.addEventListener('click',eventListener, false); if (mouseListener != null) b.addEventListener('mousedown',mouseListener, true); return b; } return null; } unsafeWindow.PTscout = function (x, y){ var a=confirm("Voulez-vous envoye un eclaireur ?"); if (a) { setTimeout (function (){ document.getElementById('mapXCoor').value = x; document.getElementById('mapYCoor').value = y; unsafeWindow.Modal.hideModalAll(); unsafeWindow.reCenterMapWithCoor(); unsafeWindow.changeview_map(document.getElementById('mod_views_map')); unsafeWindow.modal_attack(3,x,y); // on repli eclairage ?? setTimeout (function (){ var scouter = ById('modal_attack_unit_ipt3'); scouter.value=1; var evt = document.createEvent("KeyboardEvent"); if(evt.initKeyboardEvent) { evt.initKeyboardEvent("keyup",true,true,null,false,false,false,false,0x10,0); } else { evt.initKeyEvent("keyup",true,true,null,false,false,false,false,0x10,0); } scouter.dispatchEvent(evt); unsafeWindow.modal_attack_do(); }, 500); }, 0); } }; /**********************************************************************************/ function makeButton20 (label){ var a = document.createElement('a'); a.className = "button20 ptButton20"; var s = document.createElement('span'); s.innerHTML = label; a.appendChild (s); return a; } function strButton20 (label, tags){ if (tags == null) tags = ''; // return ('<A class="button20 ptButton20" '+ tags +'><SPAN>'+ label +'</span></a>' ); return ('<TABLE class=ptNoPad><TR><TD><A class="button20 ptButton20" '+ tags +'><SPAN>'+ label +'</span></a></td></tr></table>' ); } function strButton14 (label, tags){ if (tags == null) tags = ''; return ('<A class="button14 ptButton20" '+ tags +'><SPAN>'+ label +'</span></a>' ); } function cityStatusString (cs){ if (cs==4) return 'Vacation'; if (cs==3) return 'Truce'; if (cs==2) return 'Beg Protection'; return 'Normal'; } // Simple method, as if it were typed in thru DOM function sendChat (msg){ document.getElementById ("mod_comm_input").value = msg; unsafeWindow.Chat.sendChat (); } // works well, but message is not echoed back to local client Chat = { params : null, sendWhisper : function (msg, who, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 3; this.params.name = who; this._sendit (msg, notify); }, sendGlobal : function (msg, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 1; this._sendit (msg, notify); }, sendAlliance : function (msg, notify){ this.params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); this.params.ctype = 2; this._sendit (msg, notify); }, _sendit : function (msg, notify){ function strip(s) { return s.replace(/^\s+/, '').replace(/\s+$/, ''); } this.params.comment = strip (msg); new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/sendChat.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: this.params, onSuccess: function(transport) { if (notify) notify (); }, onFailure: function(transport) { if (notify) notify (); } }); }, } function doDefTrain (cityId, siege, unitId, num, notify){ var time = unsafeWindow.modal_walls_traintime(unitId, num); var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.type = unitId; params.quant = num; params.items = siege; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/fortify.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function (rslt) { if (rslt.ok) { unsafeWindow.seed.queue_fort["city" + cityId].push([unitId, num, rslt.initTS, parseInt(rslt.initTS) + time, 0, time, rslt.fortifyId]); if (notify != null) setTimeout (function (){notify(null);}, 500); } else { if (notify != null) setTimeout (function (){notify(rslt.errorMsg);}, 500); } }, onFailure: function () { if (notify != null) notify(rslt.errorMsg); }, }); } function doTrain (cityId, tut, gam, unitId, num, notify){ var time = unsafeWindow.modal_barracks_traintime(unitId, num); if(tut==36){time=parseInt(time*0.7)}else{if(tut==37){time=parseInt(time*0.5)}else{if(tut==38){time=parseInt(time*0.3)}}} var params = unsafeWindow.Object.clone(unsafeWindow.g_ajaxparams); params.cid = cityId; params.type = unitId; params.quant = num; params.items = tut; params.gambleId = gam; new MyAjaxRequest(unsafeWindow.g_ajaxpath + "ajax/train.php" + unsafeWindow.g_ajaxsuffix, { method: "post", parameters: params, onSuccess: function(rslt) { if (rslt.ok) { var resourceFactors=[],resourceLost; if(gam!=null){ time=rslt.timeNeeded; } for(var i=1;i<5;i++){ if(rslt.gamble){ resourceFactors.push(rslt.gamble[i.toString()]); }else{ resourceFactors.push(1); } resourceLost=parseInt(unsafeWindow.unitcost["unt"+unitId][i])*3600*parseInt(num);resourceLost=resourceLost*resourceFactors[i-1]; unsafeWindow.seed.resources["city"+cityId]["rec"+i][0]=parseInt(unsafeWindow.seed.resources["city"+cityId]["rec"+i][0])-resourceLost; } unsafeWindow.seed.citystats["city"+cityId].gold[0]=parseInt(unsafeWindow.seed.citystats["city"+cityId].gold[0])-parseInt(unsafeWindow.unitcost["unt"+unitId][5])*parseInt(num); unsafeWindow.seed.citystats["city"+cityId].pop[0]=parseInt(unsafeWindow.seed.citystats["city"+cityId].pop[0])-parseInt(unsafeWindow.unitcost["unt"+unitId][6])*parseInt(num); unsafeWindow.seed.queue_unt["city"+cityId].push([unitId,num,rslt.initTS,parseInt(rslt.initTS)+time,0,time,null]); if (tut!=0) unsafeWindow.seed.items["i"+tut]=Number(unsafeWindow.seed.items["i"+tut])-1; if(rslt.updateSeed) { unsafeWindow.update_seed(rslt.updateSeed) } if (notify != null) setTimeout (function (){notify(null);}, 100); } else { if (notify != null){ setTimeout (function (){notify(rslt.errorMsg);}, 100); } } }, onFailure: function(o) { if (notify != null) notify(rslt.errorMsg); } }); } /************ LIB classes/functions .... **************/ function getAbsoluteOffsets (e){ ret = {left:0, top:0}; while (e.offsetParent){ if (e.style.position == 'absolute') break; ret.left += e.offsetLeft; ret.top += e.offsetTop; e = e.offsetParent; } return ret; } DebugTimer = { startTime : 0, start : function (){ now = new Date(); DebugTimer.startTime = now.getTime(); }, display : function (label, noReset){ now = new Date(); elapsed = now.getTime() - DebugTimer.startTime; //logit (label +": "+ elapsed/1000); if (noReset===null || !noReset) DebugTimer.startTime = now.getTime(); }, }; function debugPos (e){ return 'client - offset: '+ e.clientLeft +','+ e.clientTop +','+ e.clientWidth +','+ e.clientHeight +' - '+ e.offsetLeft +','+ e.offsetTop +','+ e.offsetWidth +','+ e.offsetHeight +' '+ e +' --OP--> '+ e.offsetParent; } function debugElement (e){ var x = unsafeWindow.Object.clone (e.wrappedJSObject); x.innerHTML = ''; x.innerText = ''; x.textContent = ''; return inspect (x, 1, 1); } function getClientCoords(e){ if (e==null) return {x:null, y:null, width:null, height:null}; var x=0, y=0; ret = {x:0, y:0, width:e.clientWidth, height:e.clientHeight}; while (e.offsetParent != null){ ret.x += e.offsetLeft; ret.y += e.offsetTop; e = e.offsetParent; } return ret; } function htmlTitleLine (msg){ return '<TABLE width=100% cellspacing=0><TR><TD style="padding:0px" width=50%><HR></td><TD style="padding:0px">[ '+ msg +' ]</td><TD style="padding:0px" width=50%><HR></td></tr></table>'; } // creates a 'popup' div function CPopup (prefix, x, y, width, height, enableDrag, onClose) { // protos ... this.BASE_ZINDEX = 111111; if (unsafeWindow.cpopupWins == null) unsafeWindow.cpopupWins = {}; unsafeWindow.cpopupWins[prefix] = this; this.stmaxh = height; this.stmaxw = width; this.show = show; this.toggleHide = toggleHide; this.getTopDiv = getTopDiv; this.getMainDiv = getMainDiv; this.getZindex = getZindex; this.setZindex = setZindex; this.setEnableDrag = setEnableDrag; this.getLocation = getLocation; this.setLocation = setLocation; this.focusMe = focusMe; this.unfocusMe = unfocusMe; this.centerMe = centerMe; this.destroy = destroy; this.autoHeight = autoHeight; this.autoWidth = autoWidth; // object vars ... this.div = document.createElement('div'); this.prefix = prefix; this.onClose = onClose; var t = this; this.div.className = 'CPopup '+ prefix +'_CPopup'; this.div.style.background = "#fff"; this.div.style.zIndex = this.BASE_ZINDEX; // KOC modal is 100210 ? this.div.style.display = 'none'; this.div.style.width = width + 'px'; this.div.style.maxWidth = width + 'px'; this.div.style.height = height + 'px'; this.div.style.maxHeight = height + 'px'; this.div.style.overflowY = 'hidden'; this.div.style.position = "absolute"; this.div.style.top = y +'px'; this.div.style.left = x + 'px'; this.div.style.padding= "1px"; var m = '<TABLE cellspacing=0 width=100% height=100%><TR id="'+ prefix +'_bar" class="CPopupTop"><TD id="'+ prefix +'_top" width=99%></td>\ <TD id='+ prefix +'_X align=right valign=middle onmouseover="this.style.cursor=\'pointer\'" style="color: #fff; background: #555; padding-left: 5px; padding-right: 5px; height:15px;">X</td></tr>\ <TR><TD valign=top class="CPopMain '+ prefix +'_CPopMain" colspan=2 id="'+ prefix +'_main"></td></tr></table>'; document.body.appendChild(this.div); this.div.innerHTML = m; document.getElementById(prefix+'_X').addEventListener ('click', new CeventXClose(this).handler, false); this.dragger = new CWinDrag (document.getElementById(prefix+'_bar'), this.div, enableDrag); this.div.addEventListener ('mousedown', e_divClicked, false); function autoHeight (onoff){ if (onoff) { t.div.style.height = ''; t.div.style.maxHeight =''; } else{ t.div.style.height = t.stmaxh; t.div.style.maxHeight = t.stmaxh; } } function autoWidth (onoff){ if (onoff) { t.div.style.width = ''; t.div.style.maxWidth =''; } else{ t.div.style.width = t.stmaxw; t.div.style.maxWidth = t.stmaxw; } } function e_divClicked (){ t.focusMe(); } function CeventXClose (that){ var t = that; this.handler=handler; function handler (){ t.show(false); if (t.onClose != null) t.onClose(); } } function focusMe (){ //alert((this.BASE_ZINDEX + 5)); t.div.style.zIndex = (this.BASE_ZINDEX + 5); for (k in unsafeWindow.cpopupWins){ if (k != t.prefix) unsafeWindow.cpopupWins[k].unfocusMe(); } } function destroy (){ document.body.removeChild(t.div); //WinManager.delete (t.prefix); } function centerMe (parent){ if (parent == null){ var coords = getClientCoords(document.body); } else var coords = getClientCoords(parent); var x = ((coords.width - parseInt(t.div.style.width)) / 2) + coords.x; var y = ((coords.height - parseInt(t.div.style.height)) / 2) + coords.y; if (x<0) x = 0; if (y<0) y = 0; t.div.style.left = x +'px'; t.div.style.top = y +'px'; } function unfocusMe (){ //alert((this.BASE_ZINDEX - 5)); t.div.style.zIndex = ''+ (this.BASE_ZINDEX - 5); } function getLocation (){ return {x: parseInt(this.div.style.left), y: parseInt(this.div.style.top)}; } function setLocation (loc){ t.div.style.left = loc.x +'px'; t.div.style.top = loc.y +'px'; } function setEnableDrag (tf){ t.dragger.setEnable(tf); } function setLayer(zi){ t.div.style.zIndex = this.BASE_ZINDEX + zi; } function getLayer(){ return parseInt(t.div.style.zIndex) - this.BASE_ZINDEX; } function setZindex(zi){ this.div.style.zIndex = ''+zi; } function getZindex(){ return parseInt(this.div.style.zIndex); } function getTopDiv(){ return document.getElementById(this.prefix+'_top'); } function getMainDiv(){ return document.getElementById(this.prefix+'_main'); } function getMainTopDiv(){ return document.getElementById(this.prefix+'_top'); } function isShown (){ return t.div.style.display == 'block'; } function show(tf){ if (tf){ t.div.style.display = 'block'; t.focusMe (); } else { t.div.style.display = 'none'; } return tf; } function toggleHide(t){ if (t.div.style.display == 'block') { return t.show (false); } else { return t.show (true); } } } function CWinDrag (clickableElement, movingDiv, enabled) { var t=this; this.setEnable = setEnable; this.setBoundRect = setBoundRect; this.debug = debug; this.dispEvent = dispEvent; this.lastX = null; this.lastY = null; this.enabled = true; this.moving = false; this.theDiv = movingDiv; this.body = document.body; this.ce = clickableElement; this.moveHandler = new CeventMove(this).handler; this.outHandler = new CeventOut(this).handler; this.upHandler = new CeventUp(this).handler; this.downHandler = new CeventDown(this).handler; this.clickableRect = null; this.boundRect = null; this.bounds = null; this.enabled = false; if (enabled == null) enabled = true; this.setEnable (enabled); function setBoundRect (b){ // this rect (client coords) will not go outside of current body this.boundRect = boundRect; this.bounds = null; } function setEnable (enable){ if (enable == t.enabled) return; if (enable){ clickableElement.addEventListener('mousedown', t.downHandler, false); t.body.addEventListener('mouseup', t.upHandler, false); } else { clickableElement.removeEventListener('mousedown', t.downHandler, false); t.body.removeEventListener('mouseup', t.upHandler, false); } t.enabled = enable; } function CeventDown (that){ this.handler = handler; var t = that; function handler (me){ if (DEBUG_TRACE_DRAG) t.dispEvent ('eventDOWN', me); if (t.bounds == null){ t.clickableRect = getClientCoords(clickableElement); t.bodyRect = getClientCoords(document.body); if (t.boundRect == null) t.boundRect = t.clickableRect; if (DEBUG_TRACE_DRAG) logit ('Clickable rect: '+ inspect (t.clickableRect, 3, 1)); if (DEBUG_TRACE_DRAG) logit ('Body rect: '+ inspect (t.bodyRect, 3, 1)); if (DEBUG_TRACE_DRAG) logit ('Bound rect: '+ inspect (t.boundRect, 3, 1)); t.bounds = {top:10-t.clickableRect.height, bot:t.bodyRect.height-25, left:40-t.clickableRect.width, right:t.bodyRect.width-25}; if (DEBUG_TRACE_DRAG) logit ("BOUNDS: "+ inspect (t.bounds, 8, 10)); } if (me.button==0 && t.enabled){ t.body.addEventListener('mousemove', t.moveHandler, true); t.body.addEventListener('mouseout', t.outHandler, true); t.lastX = me.clientX; t.lastY = me.clientY; t.moving = true; } } } function CeventUp (that){ this.handler = handler; var t = that; function handler (me){ if (DEBUG_TRACE_DRAG) t.dispEvent ('eventUP', me); if (me.button==0 && t.moving) _doneMoving(t); } } function _doneMoving (t){ if (DEBUG_TRACE_DRAG) logit ('doneMoving'); t.body.removeEventListener('mousemove', t.moveHandler, true); t.body.removeEventListener('mouseout', t.outHandler, true); t.moving = false; } function CeventOut (that){ this.handler = handler; var t = that; function handler (me){ //t.dispEvent ('eventOUT', me); if (me.button==0){ t.moveHandler (me); } } } function CeventMove (that){ this.handler = handler; var t = that; function handler (me){ if (t.enabled && !t.wentOut){ //t.dispEvent ('eventMOVE', me); var newTop = parseInt(t.theDiv.style.top) + me.clientY - t.lastY; var newLeft = parseInt(t.theDiv.style.left) + me.clientX - t.lastX; if (newTop < t.bounds.top){ // if out-of-bounds... newTop = t.bounds.top; _doneMoving(t); } else if (newLeft < t.bounds.left){ newLeft = t.bounds.left; _doneMoving(t); } else if (newLeft > t.bounds.right){ newLeft = t.bounds.right; _doneMoving(t); } else if (newTop > t.bounds.bot){ newTop = t.bounds.bot; _doneMoving(t); } t.theDiv.style.top = newTop + 'px'; t.theDiv.style.left = newLeft + 'px'; t.lastX = me.clientX; t.lastY = me.clientY; } } } function debug (msg, e){ logit ("*************** "+ msg +" ****************"); logit ('clientWidth, Height: '+ e.clientWidth +','+ e.clientHeight); logit ('offsetLeft, Top, Width, Height (parent): '+ e.offsetLeft +','+ e.offsetTop +','+ e.offsetWidth +','+ e.offsetHeight +' ('+ e.offsetParent +')'); logit ('scrollLeft, Top, Width, Height: '+ e.scrollLeft +','+ e.scrollTop +','+ e.scrollWidth +','+ e.scrollHeight); } function dispEvent (msg, me){ logit (msg + ' Button:'+ me.button +' Screen:'+ me.screenX +','+ me.screenY +' client:'+ me.clientX +','+ me.clientY +' rTarget: '+ me.relatedTarget); } } function inspect(obj, maxLevels, level, doFunctions){ var str = '', type, msg; if(level == null) level = 0; if(maxLevels == null) maxLevels = 1; if(maxLevels < 1) return 'Inspect Error: Levels number must be > 0'; if(obj == null) return 'ERROR: Object is NULL\n'; var indent = ''; for (var i=0; i<level; i++) indent += ' '; for(property in obj) { try { type = matTypeof(obj[property]); if (doFunctions==true && (type == 'function')){ str += indent + '(' + type + ') ' + property + "[FUNCTION]\n"; } else if (type != 'function') { str += indent + '(' + type + ') ' + property + ( (obj[property]==null)?(': null'):('')) +' = '+ obj[property] +"\n"; } if((type=='object' || type=='array') && (obj[property] != null) && (level+1 < maxLevels)) str += inspect(obj[property], maxLevels, level+1, doFunctions); // recurse } catch(err) { // Is there some properties in obj we can't access? Print it red. if(typeof(err) == 'string') msg = err; else if(err.message) msg = err.message; else if(err.description) msg = err.description; else msg = 'Unknown'; str += '(Error) ' + property + ': ' + msg +"\n"; } } str += "\n"; return str; } Array.prototype.compare = function(testArr) { if (this.length != testArr.length) return false; for (var i = 0; i < testArr.length; i++) { if (this[i].compare) { if (!this[i].compare(testArr[i])) return false; } if (this[i] !== testArr[i]) return false; } return true; } String.prototype.entityTrans = { '&':'&', '<':'<', '>':'>', '\"':'"' }; String.prototype.htmlEntities = function() { var ret = this.toString(); for (k in this.entityTrans) ret = ret.split(k).join(this.entityTrans[k]); return ret; } String.prototype.stripTags = function(){ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } String.prototype.capitalize = function(){ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function objectName (o){ var s = o.toString(); return s.substr(7,s.length-8); } function matTypeof (v){ if (v == undefined) return 'undefined'; if (typeof (v) == 'object'){ if (!v) return 'null'; else if (v.constructor.toString().indexOf("Array")>=0 && typeof(v.splice)=='function') return 'array'; else return 'object'; } return typeof (v); } function addCommasInt(n){ nStr = parseInt(n) + ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(nStr)) { nStr = nStr.replace(rgx, '$1' + ',' + '$2'); } return nStr; } function addCommas(nStr){ nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function htmlSelector (valNameArray, curVal, tags){ m = []; m.push ('<SELECT'); if (tags){ m.push (' '); m.push (tags); } for (k in valNameArray){ m.push ('><OPTION '); if (k == curVal) m.push ('SELECTED '); m.push ('value="'); m.push (k); m.push ('">'); m.push (valNameArray[k]); m.push ('</option>'); } m.push ('</select>'); return m.join (''); } function unixTime (){ return parseInt (new Date().getTime() / 1000) + unsafeWindow.g_timeoff; } function timestrShort(time) { time = parseInt (time); if (time > 86400){ var m = []; time /= 3600; m.push (parseInt(time/24)); m.push ('d '); m.push (parseInt(time%24)); m.push ('h '); return m.join (''); } else return timestr (time); } function timestr(time, full) { time = parseInt (time); var m = []; var t = time; if (t < 61) return t + 's'; if (t > 86400){ m.push (parseInt(t/86400)); m.push ('d '); t %= 86400; } if (t>3600 || time>3600){ m.push (parseInt(t/3600)); m.push ('h '); t %= 3600; } m.push (parseInt(t/60)); m.push ('m'); if (full || time<=3600 ){ m.push (' '); m.push (t%60); m.push ('s'); } return m.join (''); } function getCityBuilding (cityId, buildingId){ var b = Seed.buildings['city'+cityId]; var ret = {count:0, maxLevel:0}; for (var i=1; i<33; i++){ if (b['pos'+i] && b['pos'+i][0] == buildingId){ ++ret.count; if (parseInt(b['pos'+i][1]) > ret.maxLevel) ret.maxLevel = parseInt(b['pos'+i][1]); } } return ret; } function getMyAlliance (){ if (Seed.allianceDiplomacies==null || Seed.allianceDiplomacies.allianceName==null) return [0, 'None']; else return [Seed.allianceDiplomacies.allianceId, Seed.allianceDiplomacies.allianceName]; } /************ LIB singletons .... **************/ // TODO: fix REopening window var WINLOG_MAX_ENTRIES = 1000; // TODO var WinLog = { state : null, win: null, eOut : null, lastE : null, enabled : true, reverse : true, busy : false, isOpening : false, open : function (){ var t = WinLog; function eventButClear(){ var t = WinLog; t.lastE = null; t.eOut.innerHTML =''; } function eventButReverse(){ var t = WinLog; if (t.busy) return; t.busy = true; if (t.reverse){ t.win.document.getElementById('wlRev').value= 'Top'; t.reverse = false; } else{ t.win.document.getElementById('wlRev').value= 'Bottom'; t.reverse = true; } var n = t.eOut.childNodes.length; if (n < 2) return; for (i=n-2; i>=0; i--){ t.eOut.appendChild (t.eOut.childNodes[i]); } t.busy = false; } if (!t.win || t.win.closed){ t.isOpening = true; // Firefox bug??? It appears as if a new thread is started on open, withOUT reusing same window t.win = window.open('', 'uwtrace', 'top=30,left=0,width=900,height=700,scrollbars=no,location=no,menubar=no,directories=no,status=no'); t.isOpening = false; t.state = null; } if (t.state == null){ t.win.document.body.innerHTML = '<STYLE>pre{margin:0px} hr{margin:3px; height:1px; border:0px; color:#cee; background-color:#cee}</style>\ <BODY style="margin:0px; padding:0px; border:none">\ <DIV id=winlogtop style="background-color:#d0d0d0; margin:0px; padding:0px; border:1px solid">\ <INPUT id=wlClear type=submit value="Clear"> <INPUT id=wlRev type=submit value="Bottom"></div>\ <DIV id=wlOut style="overflow-y:auto; height:100%; max-height:100%"></div></body>'; t.win.document.getElementById('wlClear').addEventListener('click', eventButClear, false); t.win.document.getElementById('wlRev').addEventListener('click', eventButReverse, false); t.eOut = t.win.document.getElementById('wlOut'); t.lastE = null; t.state = 1; } }, writeText : function (msg){ WinLog.write (msg.htmlEntities()); }, write : function (msg){ var t = WinLog; if (!t.enabled || t.isOpening) return; t.open(); var te = document.createElement('pre'); var now = new Date(); var m = []; var millis = now.getMilliseconds(); m.push (now.toTimeString().substring (0,8)); m.push ('.'); if (millis<100) m.push('0'); if (millis<10) m.push('0'); m.push(millis); m.push (': '); m.push (msg); te.innerHTML = m.join(''); if (t.reverse){ if (t.lastE == null){ t.eOut.appendChild(te); t.lastE = te; } else { t.eOut.insertBefore(te, t.lastE); } var hr = document.createElement('hr'); t.eOut.insertBefore(hr, te); t.lastE = hr; } else { t.eOut.appendChild(te); t.eOut.appendChild(document.createElement('hr')); } }, }; function ById(id) { return document.getElementById(id); } function addCommasWhole(nStr){ nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1; } function SelectAll(id) { document.getElementById(id).focus();document.getElementById(id).select(); } var nHtml={ FindByXPath:function(obj,xpath,nodetype) { if(!nodetype){ nodetype = XPathResult.FIRST_ORDERED_NODE_TYPE; } try { var q=document.evaluate(xpath,obj,null,nodetype,null); } catch(e) { GM_log('bad xpath:'+xpath); } if(nodetype == XPathResult.FIRST_ORDERED_NODE_TYPE){ if(q && q.singleNodeValue) { return q.singleNodeValue; } }else{ if(q){ return q; } } return null; }, ClickWin:function(win,obj,evtName) { var evt = win.document.createEvent("MouseEvents"); evt.initMouseEvent(evtName, true, true, win, 0, 0, 0, 0, 0, false, false, false, false, 0, null); return !obj.dispatchEvent(evt); }, Click:function(obj) { return this.ClickWin(window,obj,'click'); }, ClickTimeout:function(obj,millisec) { window.setTimeout(function() { return nHtml.ClickWin(window,obj,'click'); },millisec+Math.floor(Math.random()*500)); }, SetSelect:function(obj,v) { for(var o=0; o<obj.options.length; o++) { if(v==obj.options[o].value) { obj.options[o].selected=true; return true; } } return false; } }; ptStartup ();
Mozilla add on,User script,Grease Monkey Script, greasemonkey userscripts, updater userscripts mafia wars userscripts mafia wars autoplayer userscripts mafia wars wall userscripts scripts userscripts travian greasemonkey greasemonkey download greasemonkey facebook greasemonkey tutorial greasemonkey youtube greasemonkey travian greasemonkey chrome greasemonkey mafia wars greasemonkey mafia wars autoplayer
Saturday, October 1, 2011
Boite Outils - KOC - BeWorld
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment