Welcome
Welcome to the <strong>Tribal Wars Enhancer</strong> forums!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. <a href="/profile.php?mode=register">Join our community today</a> and help improve the tribal wars game!

Morale

Create your own plugins and upload them here

Moderators: enduo, Developers

Morale

Postby johndoe on Fri May 30, 2008 10:09 am

Adds morale to the world map, so you can see how sad your men will be if you charge this puny village.

Code: Select all
   plugins.worldmorale = { // calculates traveltimes on the map

   'enhance_game_map': function() {
      $("#info_content #info_extra_info").after("<tr><td>Morale</td><td id=\"info_morale\"></td></tr>");
      var old_map_popup = unsafeWindow.map_popup;
      setFunc("map_popup", function map_popup(title, bonus_image, bonus_text, points, owner, ally, village_groups, moral, village_id, source_id) {

      old_map_popup(title, bonus_image, bonus_text, points, owner, ally, village_groups, moral, village_id, source_id);

      window.setTimeout(function() {
         if (owner == null) {
            $("#info_morale").html("100%");
         } else {
            var MyPoints = (xpathGetFirst("/html/body/table[1]/tbody/tr/td[6]").innerHTML).replace('<span class="grey">.</span>',"").match(/\|(\d+) P\)/)[1];
            var HisPoints = owner.match(/\(([\d.]+) Points\)/)[1].replace(".","");
            var Target_Coords = title.match(/\((-?\d+)\|(-?\d+)\)/);
            $("#info_morale").html(((t = ((t = Math.round(30+(300/(MyPoints/HisPoints)))) > 100 ? 100 : t)) < 30 ? 30 : t) + "%");
         }
      }, 0);

   });
   },

   'info' : {
      'mandatory' : false,
      'name' : "Morale",
      'desc' : "Adds morale to the world map",
      'version' : "0.1",
      'dev' : "JohnDoe"
     }
   };
johndoe
 
Posts: 115
Joined: Thu Mar 13, 2008 12:28 pm

Postby AeroFury on Fri May 30, 2008 11:28 am

You rock, mister!

Could anyone make a 'Sticky' and describe how exactly these plugins can be installed? I think I know how, but I'm guessing some people dont.
AeroFury
Beta tester
 
Posts: 48
Joined: Tue Feb 19, 2008 11:29 pm

Postby peca on Fri May 30, 2008 1:51 pm

Seems not work on cs6.divokekmeny.cz
Still shows 100%, even I have over 6000 pts and tagget village has less then 100 pts. If some test data needed, pls PM me. I'll be on line et evening at about 21:00 (Central Europe Summer Time = UTC +2 (I hope))
peca
 
Posts: 5
Joined: Mon May 19, 2008 10:14 pm

Postby el-barto on Fri Sep 05, 2008 6:35 am

Doesn't work on the Swedish server :(

It just says 100% all the time, just like it does for peca
el-barto
 
Posts: 3
Joined: Sun May 18, 2008 11:55 am

Postby Skorpishor on Fri Dec 19, 2008 9:15 am

Same for romanian servers :twisted:
Skorpishor
 
Posts: 1
Joined: Fri Dec 19, 2008 9:13 am

Postby Hooch180 on Fri Dec 26, 2008 9:11 pm

I have got always 100%
Hooch180
 
Posts: 2
Joined: Thu Dec 25, 2008 4:00 pm

Postby enduo on Sun Jan 04, 2009 2:18 pm

yes the dev of this quit i think
enduo
 
Posts: 166
Joined: Mon Aug 18, 2008 6:03 pm


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests