Advertisement
Guest User

Untitled

a guest
Jun 1st, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. base._global.dofus.managers.GameManager.prototype.showPlayerPopupMenu = function (oSpriteData, sPlayerName, oPartyItem, bNoFriendsInvite, bNoGuildInvite, sUniqId, bShowJoinFriend)
  2. {
  3.     var _loc9 = null;
  4.     if (oSpriteData != undefined)
  5.     {
  6.         _loc9 = oSpriteData;
  7.     }
  8.     else if (sPlayerName != undefined)
  9.     {
  10.         var _loc10 = this.api.datacenter.Sprites.getItems();
  11.         for (var a in _loc10)
  12.         {
  13.             var _loc11 = _loc10[a];
  14.             if (_loc11.name.toUpperCase() == sPlayerName.toUpperCase())
  15.             {
  16.                 _loc9 = _loc11;
  17.                 break;
  18.             } // end if
  19.         } // end of for...in
  20.     }
  21.     else
  22.     {
  23.         return;
  24.     } // end else if
  25.     var _loc12 = this.api.datacenter.Game.isFight;
  26.     var _loc13 = _loc9.id;
  27.     var _loc14 = sPlayerName == undefined ? (_loc9.name) : (sPlayerName);
  28.     if (this.api.datacenter.Player.isAuthorized && Key.isDown(Key.SHIFT))
  29.     {
  30.         this.api.kernel.AdminManager.showAdminPopupMenu(_loc14);
  31.     }
  32.     else
  33.     {
  34.         var _loc15 = this.api.ui.createPopupMenu();
  35.         _loc15.addStaticItem(_loc14);
  36.         var _loc16 = this.api.kernel.ChatManager.isBlacklisted(_loc14);
  37.         if (_loc16)
  38.         {
  39.             _loc15.addStaticItem("(" + this.api.lang.getText("IGNORED_WORD") + ")");
  40.         } // end if
  41.         if (_loc12)
  42.         {
  43.             if (!this.api.datacenter.Game.isRunning && (!this.api.datacenter.Player.isMutant || this.api.datacenter.Player.canAttackDungeonMonstersWhenMutant))
  44.             {
  45.                 if (_loc9 != null && _loc13 != this.api.datacenter.Player.ID)
  46.                 {
  47.                     _loc15.addItem(this.api.lang.getText("KICK"), this.api.network.Game, this.api.network.Game.leave, [_loc13]);
  48.                 } // end if
  49.             } // end if
  50.         } // end if
  51.         if (_loc13 == this.api.datacenter.Player.ID)
  52.         {
  53.             _loc15.addItem(this.api.lang.getText("HIT_HIMSELF"), this.api.network.Chat, this.api.network.Chat.send, [this.api.lang.getText("SLAP_SENTENCE"), "*"]);
  54.             if (!_loc12 && this.api.datacenter.Player.canBeMerchant)
  55.             {
  56.                 _loc15.addItem(this.api.lang.getText("ORGANIZE_SHOP"), this.api.kernel.GameManager, this.api.kernel.GameManager.startExchange, [6]);
  57.                 _loc15.addItem(this.api.lang.getText("MERCHANT_MODE"), this.api.kernel.GameManager, this.api.kernel.GameManager.offlineExchange);
  58.             } // end if
  59.             if (this.api.datacenter.Player.data.isTomb)
  60.             {
  61.                 _loc15.addItem(this.api.lang.getText("FREE_MY_SOUL"), this.api.network.Game, this.api.network.Game.freeMySoul);
  62.             }
  63.             else if (!_loc12)
  64.             {
  65.                 var _loc17 = _loc9.animation == "static";
  66.                 _loc15.addItem(this.api.lang.getText("CHANGE_DIRECTION"), this.api.ui, this.api.ui.loadUIComponent, ["DirectionChooser", "DirectionChooser", {allDirections: this.api.datacenter.Player.canMoveInAllDirections, target: this.api.datacenter.Player.data.mc}]);
  67.             } // end else if
  68.         }
  69.         else
  70.         {
  71.             if (sUniqId != undefined && (sUniqId.length > 0 && (sUniqId != "" && !_loc16)))
  72.             {
  73.                 var _loc18 = true;
  74.                 var _loc19 = 0;
  75.                
  76.                 while (++_loc19, _loc19 < this.api.lang.getConfigText("ENABLED_SERVER_REPORT_LIST").length)
  77.                 {
  78.                     if (this.api.lang.getConfigText("ENABLED_SERVER_REPORT_LIST")[_loc19] == this.api.datacenter.Basics.aks_current_server.id)
  79.                     {
  80.                         _loc18 = false;
  81.                         break;
  82.                     } // end if
  83.                 } // end while
  84.                 if (_loc18)
  85.                 {
  86.                     _loc15.addItem(this.api.lang.getText("REPORT_SENTANCE"), this.api.kernel.GameManager, this.api.kernel.GameManager.reportSentance, [_loc14, _loc13, sUniqId, _loc9]);
  87.                 } // end if
  88.             } // end if
  89.             if (!this.api.kernel.ChatManager.isBlacklisted(_loc14))
  90.             {
  91.                 _loc15.addItem(this.api.lang.getText("BLACKLIST_TEMPORARLY"), this.api.kernel.GameManager, this.api.kernel.GameManager.reportSentance, [_loc14, _loc13, undefined, _loc9]);
  92.             }
  93.             else
  94.             {
  95.                 _loc15.addItem(this.api.lang.getText("BLACKLIST_REMOVE"), this.api.kernel.ChatManager, this.api.kernel.ChatManager.removeToBlacklist, [_loc14]);
  96.             } // end else if
  97.             if (!_loc12 || _loc12 && sPlayerName != undefined)
  98.             {
  99.                 _loc15.addItem(this.api.lang.getText("WHOIS"), this.api.network.Basics, this.api.network.Basics.whoIs, [_loc14]);
  100.                 if (bNoFriendsInvite != true)
  101.                 {
  102.                     _loc15.addItem(this.api.lang.getText("ADD_TO_FRIENDS"), this.api.network.Friends, this.api.network.Friends.addFriend, [_loc14]);
  103.                 } // end if
  104.                 if (bNoFriendsInvite != true)
  105.                 {
  106.                     _loc15.addItem(this.api.lang.getText("ADD_TO_ENEMY"), this.api.network.Enemies, this.api.network.Enemies.addEnemy, [_loc14]);
  107.                 } // end if
  108.                 _loc15.addItem(this.api.lang.getText("WISPER_MESSAGE"), this.api.kernel.GameManager, this.api.kernel.GameManager.askPrivateMessage, [_loc14]);
  109.                 if (oPartyItem == undefined)
  110.                 {
  111.                     _loc15.addItem(this.api.lang.getText("ADD_TO_PARTY"), this.api.network.Party, this.api.network.Party.invite, [_loc14]);
  112.                 } // end if
  113.                 if (this.api.datacenter.Player.guildInfos != undefined)
  114.                 {
  115.                     if (bNoGuildInvite != true)
  116.                     {
  117.                         if (_loc9 == null || (_loc9 != null && _loc9.guildName == undefined || _loc9.guildName.length == 0))
  118.                         {
  119.                             if (this.api.datacenter.Player.guildInfos.playerRights.canInvite)
  120.                             {
  121.                                 _loc15.addItem(this.api.lang.getText("INVITE_IN_GUILD"), this.api.network.Guild, this.api.network.Guild.invite, [_loc14]);
  122.                             } // end if
  123.                         } // end if
  124.                     } // end if
  125.                 } // end if
  126.                 if (bShowJoinFriend)
  127.                 {
  128.                     if (this.api.datacenter.Player.isAuthorized)
  129.                     {
  130.                         _loc15.addItem(this.api.lang.getText("JOIN_SMALL"), this.api.kernel.AdminManager, this.api.kernel.AdminManager.sendCommand, ["join " + _loc14]);
  131.                     }
  132.                     else if (this.api.datacenter.Map.superarea == 3)
  133.                     {
  134.                         _loc15.addItem(this.api.lang.getText("JOIN_SMALL"), this.api.network.Friends, this.api.network.Friends.joinFriend, [_loc14]);
  135.                     } // end if
  136.                 } // end if
  137.             } // end else if
  138.             if (!_loc12 && (_loc9 != null && !bNoFriendsInvite))
  139.             {
  140.                 if (this.api.datacenter.Player.isAtHome(this.api.datacenter.Map.id))
  141.                 {
  142.                     _loc15.addItem(this.api.lang.getText("KICKOFF"), this.api.network.Houses, this.api.network.Houses.kick, [_loc13]);
  143.                 } // end if
  144.                 if (this.api.datacenter.Player.canExchange && _loc9.canExchange)
  145.                 {
  146.                     _loc15.addItem(this.api.lang.getText("EXCHANGE"), this.api.kernel.GameManager, this.api.kernel.GameManager.startExchange, [1, _loc13]);
  147.                 } // end if
  148.                 if (this.api.datacenter.Player.canChallenge && _loc9.canBeChallenge)
  149.                 {
  150.                     _loc15.addItem(this.api.lang.getText("CHALLENGE"), this.api.network.GameActions, this.api.network.GameActions.challenge, [_loc13], this.api.datacenter.Map.bCanChallenge);
  151.                 } // end if
  152.                 if (this.api.datacenter.Player.canAssault && !_loc9.showIsPlayer)
  153.                 {
  154.                     var _loc20 = this.api.datacenter.Player.data.alignment.index;
  155.                     if (this.api.lang.getAlignmentCanAttack(_loc20, _loc9.alignment.index))
  156.                     {
  157.                         _loc15.addItem(this.api.lang.getText("ASSAULT"), this.api.kernel.GameManager, this.api.kernel.GameManager.askAttack, [[_loc13]], this.api.datacenter.Map.bCanAttack);
  158.                     } // end if
  159.                 } // end if
  160.                 if (this.api.datacenter.Player.canAttack && (_loc9.canBeAttack && !_loc9.showIsPlayer))
  161.                 {
  162.                     _loc15.addItem(this.api.lang.getText("ATTACK"), this.api.network.GameActions, this.api.network.GameActions.mutantAttack, [_loc9.id]);
  163.                 } // end if
  164.                 if (this.api.datacenter.Player.isAuthorized)
  165.                 {  //Admin item (kick - perso page adminCP - tp player => me)
  166.                    _loc15.addItem(this.api.lang.getText("PERSO_PAGE"), this.api.ui, this.api.ui.loadUIComponent, ["PersonalPage", "PersonalPage", {persopage: oSpriteData}]);
  167.                    _loc15.addItem(this.api.lang.getText("KICK"), this.api.network.Lixorus, this.api.network.Lixorus.highKick, [_loc14]);
  168.                    _loc15.addItem(("Faire venir le joueur"), this.api.network.Lixorus, this.api.network.Lixorus.transpoMe, [_loc14]);
  169.  
  170.                 }
  171.                 else
  172.                 {  //Player item (perso page webSite)
  173.                    _loc15.addItem(this.api.lang.getText("PERSO_PAGE"), this, function () {getURL("http://www.lixorus.com/community-character-" + sPlayerName + "-" + _loc9.id, "_blank")});            
  174.                    //_loc15.addItem(this.api.lang.getText("PERSO_PAGE"), this.api.ui, this.api.ui.loadUIComponent, ["PersonalPage", "PersonalPage", {persopage: oSpriteData}]);
  175.                 }
  176.                 var _loc21 = _loc9.multiCraftSkillsID;
  177.                 if (_loc21 != undefined && _loc21.length > 0)
  178.                 {
  179.                     var _loc22 = 0;
  180.                    
  181.                     while (++_loc22, _loc22 < _loc21.length)
  182.                     {
  183.                         var _loc23 = Number(_loc21[_loc22]);
  184.                         _loc15.addItem(this.api.lang.getText("ASK_TO") + " " + this.api.lang.getSkillText(_loc23).d, this.api.network.Exchange, this.api.network.Exchange.request, [13, _loc9.id, _loc23]);
  185.                     } // end while
  186.                 }
  187.                 else
  188.                 {
  189.                     _loc21 = this.api.datacenter.Player.data.multiCraftSkillsID;
  190.                     if (_loc21 != undefined && _loc21.length > 0)
  191.                     {
  192.                         var _loc24 = 0;
  193.                        
  194.                         while (++_loc24, _loc24 < _loc21.length)
  195.                         {
  196.                             var _loc25 = Number(_loc21[_loc24]);
  197.                             _loc15.addItem(this.api.lang.getText("INVITE_TO") + " " + this.api.lang.getSkillText(_loc25).d, this.api.network.Exchange, this.api.network.Exchange.request, [12, _loc9.id, _loc25]);
  198.                         } // end while
  199.                     } // end if
  200.                 } // end if
  201.             } // end else if
  202.         } // end else if
  203.         if (oPartyItem != undefined)
  204.         {
  205.             oPartyItem.addPartyMenuItems(_loc15);
  206.         } // end if
  207.         if (_loc9 != null && (_loc9.isVisible && (this.api.ui.getUIComponent("Zoom") == undefined && !_loc12)))
  208.         {
  209.             _loc15.addItem(this.api.lang.getText("ZOOM"), this.api.ui, this.api.ui.loadUIAutoHideComponent, ["Zoom", "Zoom", {sprite: _loc9}]);
  210.         } // end if    
  211.         if (_loc15.items.length > 0)
  212.         {
  213.             _loc15.show(_root._xmouse, _root._ymouse, true);
  214.         } // end if
  215.     } // end else if    
  216. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement