Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class AutomaticPlay Extends UICommonAPI
- dependson(YetiQuickSlotWnd)
- dependson(YetiQuickSlotWnd);
- var WindowHandle AutoTargetWnd;
- var TextBoxHandle AutoTargetTitle_text;
- var AnimTextureHandle AutoTargetAllON_ToggleEffect_Anim;
- var AnimTextureHandle AutoTargetAllON_ToggleEffect_Anim2;
- var ButtonHandle WinMinBTN;
- var TextureHandle AutoCircleFrameExpand;
- var TextureHandle LineBG;
- var ButtonHandle TargetNext_BTN;
- var ButtonHandle TargetSwap_BTN;
- var ButtonHandle TargetPickupToggle_BTN;
- var ButtonHandle TargetMannerToggle_BTN;
- var ButtonHandle Combat_BTN;
- var WindowHandle AutoTargetAllON_Win;
- var WindowHandle AutoTargetAllOFF_Win;
- var ButtonHandle AutoTargetAll_BTN;
- var bool autotarget_bShortTarget;
- var bool autotarget_bUseAutoTarget;
- var bool autotarget_bIsPickupOn;
- var NWindow.UIEventManager.EAutoNextTargetMode autotarget_nTargetMode;
- var int autotarget_nHPPotionPercent;
- var bool autotarget_bIsMannerModeOn;
- var bool bActivateAll;
- var int nCombatOnOff;
- var int autotarget_nHPPetPotionPercent;
- var YetiQuickSlotWnd YetiQuickSlotwndScript;
- var Rect rectWndLDowned;
- function OnRegisterEvent()
- {
- RegisterEvent(9750);
- RegisterEvent(40);
- RegisterEvent(11170);
- RegisterEvent(11030);
- RegisterEvent(5720);
- RegisterEvent(11152);
- RegisterEvent(11280);
- RegisterEvent(11620);
- return;
- }
- function OnLoad()
- {
- Initialize();
- return;
- }
- function Initialize()
- {
- AutoTargetWnd = GetWindowHandle("AutomaticPlay.AutoTargetWnd");
- AutoTargetTitle_text = GetTextBoxHandle("AutomaticPlay.AutoTargetWnd.AutoTargetTitle_text");
- AutoTargetAllON_ToggleEffect_Anim = GetAnimTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win.ToggleEffect_Anim");
- AutoTargetAllON_ToggleEffect_Anim2 = GetAnimTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win.AutoAllArrowOn_texture");
- AutoTargetAllON_Win = GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win");
- WinMinBTN = GetButtonHandle("AutomaticPlay.WinMinBTN");
- LineBG = GetTextureHandle("AutomaticPlay.LineBgTex");
- AutoCircleFrameExpand = GetTextureHandle("AutomaticPlay.AutoTargetWnd.AutoCircleFrameExpand");
- TargetNext_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.TargetNext_BTN");
- TargetSwap_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.TargetSwap_BTN");
- TargetPickupToggle_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.TargetPickupToggle_BTN");
- TargetMannerToggle_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.TargetMannerToggle_BTN");
- AutoTargetAllOFF_Win = GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllOFF_Win");
- AutoTargetAll_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAll_BTN");
- Combat_BTN = GetButtonHandle("AutomaticPlay.AutoTargetWnd.Combat_BTN");
- setCombatTooltip();
- Autotarget_updateCombatButton();
- YetiQuickSlotwndScript = YetiQuickSlotWnd(GetScript("YetiQuickSlotwnd"));
- WinMinBTN.SetButtonValue(0);
- return;
- }
- function OnShow()
- {
- if(getInstanceUIData().getIsLiveServer())
- {
- m_hOwnerWnd.HideWindow();
- return;
- }
- OptionIniLoad();
- updateElements();
- return;
- }
- function updateElements()
- {
- Autotarget_UpdateAutoTargetState();
- Autotarget_updateSwapTargetButton();
- Autotarget_SwapTargetSetCusomTooltip();
- Autotarget_updatePickupButton();
- Autotarget_PickupSetCusomTooltip();
- Autotarget_updateMannerModeButton();
- Autotarget_MannerModeSetCusomTooltip();
- Autotarget_updateNextTargetButton();
- Autotarget_NextTargetSetCusomTooltip();
- return;
- }
- function OnEvent(int Event_ID, string param)
- {
- if(getInstanceUIData().getIsLiveServer())
- {
- return;
- }
- switch(Event_ID)
- {
- case 9750:
- initAll();
- break;
- case 40:
- bActivateAll = False;
- nCombatOnOff = 0;
- setCombatTooltip();
- Autotarget_updateCombatButton();
- Autotarget_Init();
- break;
- case 11170:
- AutoplaySettingHandler(param);
- break;
- case 11030:
- case 5720:
- NextTargetModeHandler();
- break;
- case 11152:
- if(autotarget_bUseAutoTarget)
- {
- requestAutoPlay(False);
- }
- break;
- case 11280:
- ParseInt(param, "OnOff", nCombatOnOff);
- setCombatTooltip();
- Autotarget_updateCombatButton();
- break;
- case 11620:
- HandleUpdatePlayerAutoAttacking();
- break;
- default:
- break;
- }
- return;
- }
- function setCombatTooltip()
- {
- local array<DrawItemInfo> drawListArr;
- if(nCombatOnOff > 0)
- {
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13263), getInstanceL2Util().PKNameColor, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13264), getInstanceL2Util().White, "", True, True);
- }
- else
- {
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13263), getInstanceL2Util().White, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13264), getInstanceL2Util().PKNameColor, "", True, True);
- }
- Combat_BTN.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
- return;
- }
- function initAll()
- {
- m_hOwnerWnd.ShowWindow();
- bActivateAll = False;
- YetiQuickSlotwndScript.setPlayAutoTargetActiveAnim();
- return;
- }
- function NextTargetModeHandler()
- {
- local NWindow.UIEventManager.EAutoNextTargetMode nTargetMode;
- nTargetMode = GetNextTargetModeOption();
- if(int(autotarget_nTargetMode) != int(nTargetMode))
- {
- if(autotarget_bUseAutoTarget)
- {
- requestAutoPlay(autotarget_bUseAutoTarget);
- }
- }
- Autotarget_NextTargetSetCusomTooltip();
- return;
- }
- function AutoplaySettingHandler(string param)
- {
- local int nIsAutoPlayOn, nNextTargetMode, nIsNearTargetMode, nIsPickupOn, nHPPotionPercent, nIsMannerModeOn,
- nHPPetPotionPercent;
- ParseInt(param, "IsPickupOn", nIsPickupOn);
- ParseInt(param, "IsAutoPlayOn", nIsAutoPlayOn);
- ParseInt(param, "NextTargetMode", nNextTargetMode);
- ParseInt(param, "IsNearTargetMode", nIsNearTargetMode);
- ParseInt(param, "HPPotionPercent", nHPPotionPercent);
- ParseInt(param, "HPPetPotionPercent", nHPPetPotionPercent);
- ParseInt(param, "IsMannerModeOn", nIsMannerModeOn);
- autotarget_bUseAutoTarget = numToBool(nIsAutoPlayOn);
- autotarget_bShortTarget = numToBool(nIsNearTargetMode);
- autotarget_bIsPickupOn = numToBool(nIsPickupOn);
- autotarget_bIsMannerModeOn = numToBool(nIsMannerModeOn);
- autotarget_nHPPotionPercent = nHPPotionPercent;
- autotarget_nHPPetPotionPercent = nHPPetPotionPercent;
- updateElements();
- return;
- }
- function bool getActivateAll()
- {
- return bActivateAll;
- }
- function OnClickButton(string Name)
- {
- if(CheckDrag())
- {
- return;
- }
- switch(Name)
- {
- case "WinMinBTN":
- WinMinMax();
- break;
- case "AutoAll_BTN":
- Class'ShortcutWndAPI'.static.RequestAutomaticUseItemActivateAll(!bActivateAll);
- break;
- case "TargetSwap_BTN":
- Autotarget_OnSwap_Target_BTNClick();
- requestAutoPlay(autotarget_bUseAutoTarget);
- break;
- case "TargetPickupToggle_BTN":
- Autotarget_TargetPickupToggle_BTNClick();
- requestAutoPlay(autotarget_bUseAutoTarget);
- break;
- case "TargetMannerToggle_BTN":
- Autotarget_TargetMannerToggle_BTNClick();
- requestAutoPlay(autotarget_bUseAutoTarget);
- break;
- case "AutoTargetAll_BTN":
- requestAutoPlay(!autotarget_bUseAutoTarget);
- break;
- case "Combat_BTN":
- ExecuteCommand("/combatmode");
- break;
- case "TargetNext_BTN":
- Autotarget_OnNext_Target_BTNClick();
- break;
- default:
- break;
- }
- return;
- }
- function OnRButtonDown(WindowHandle a_WindowHandle, int X, int Y)
- {
- if("AutoAll_BTN" == a_WindowHandle.GetWindowName())
- {
- OnClickButton(a_WindowHandle.GetWindowName());
- }
- return;
- }
- function bool CheckDrag()
- {
- local Rect rectWnd;
- rectWnd = m_hOwnerWnd.GetRect();
- return ((GetAbs(rectWndLDowned.nX - rectWnd.nX)) > 5) || (GetAbs(rectWndLDowned.nY - rectWnd.nY)) > 5;
- }
- event OnLButtonDown(WindowHandle a_WindowHandle, int X, int Y)
- {
- rectWndLDowned = m_hOwnerWnd.GetRect();
- return;
- }
- function OptionIniLoad()
- {
- local int nLongTarget, nIsPickupOn, nIsMannerModeOn, nMinimize;
- if(!GetINIBool("AutomaticPlay", "e", nIsPickupOn, "windowsInfo.ini"))
- {
- nIsPickupOn = 1;
- SetINIBool("AutomaticPlay", "e", numToBool(nIsPickupOn), "windowsInfo.ini");
- }
- if(!GetINIBool("AutomaticPlay", "a", nLongTarget, "windowsInfo.ini"))
- {
- nLongTarget = 1;
- SetINIBool("AutomaticPlay", "a", numToBool(nLongTarget), "windowsInfo.ini");
- }
- if(!GetINIBool("AutomaticPlay", "p", nIsMannerModeOn, "windowsInfo.ini"))
- {
- nIsMannerModeOn = 1;
- SetINIBool("AutomaticPlay", "p", numToBool(nIsMannerModeOn), "windowsInfo.ini");
- }
- GetINIBool("AutomaticPlay", "v", nMinimize, "windowsInfo.ini");
- if(nMinimize == 1)
- {
- SetMin();
- }
- else
- {
- SetMax();
- }
- autotarget_bIsPickupOn = numToBool(nIsPickupOn);
- autotarget_bShortTarget = !numToBool(nLongTarget);
- autotarget_bIsMannerModeOn = numToBool(nIsMannerModeOn);
- return;
- }
- function Autotarget_Init()
- {
- autotarget_bUseAutoTarget = False;
- return;
- }
- function executeTarget()
- {
- if(autotarget_bShortTarget)
- {
- ExecuteCommand("/targetnext");
- }
- else
- {
- ExecuteCommand("/targetnext2");
- }
- return;
- }
- function setShortcutTooltip(string tooltipStr)
- {
- AutoTargetAll_BTN.SetTooltipCustomType(MakeTooltipMultiText(GetSystemString(2165), getInstanceL2Util().White,, True, tooltipStr, getInstanceL2Util().BWhite,, True));
- return;
- }
- function Autotarget_SwapTargetSetCusomTooltip()
- {
- local Color b0, b1;
- local array<DrawItemInfo> drawListArr;
- b0 = getInstanceL2Util().Gray;
- b1 = getInstanceL2Util().Gray;
- if(autotarget_bShortTarget)
- {
- b0 = getInstanceL2Util().Yellow;
- }
- else
- {
- b1 = getInstanceL2Util().Yellow;
- }
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3956), b0, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3957), b1, "", True, True);
- TargetSwap_BTN.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
- return;
- }
- function Autotarget_PickupSetCusomTooltip()
- {
- local Color b0, b1;
- local array<DrawItemInfo> drawListArr;
- b0 = getInstanceL2Util().Gray;
- b1 = getInstanceL2Util().Gray;
- TargetPickupToggle_BTN.ClearTooltip();
- TargetPickupToggle_BTN.SetTooltipType("text");
- if(autotarget_bIsPickupOn)
- {
- b0 = getInstanceL2Util().Yellow;
- }
- else
- {
- b1 = getInstanceL2Util().Yellow;
- }
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3993), b0, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3992), b1, "", True, True);
- TargetPickupToggle_BTN.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
- return;
- }
- function Autotarget_MannerModeSetCusomTooltip()
- {
- local Color b0, b1;
- local array<DrawItemInfo> drawListArr;
- b0 = getInstanceL2Util().Gray;
- b1 = getInstanceL2Util().Gray;
- TargetMannerToggle_BTN.ClearTooltip();
- TargetMannerToggle_BTN.SetTooltipType("text");
- if(autotarget_bIsMannerModeOn)
- {
- b0 = getInstanceL2Util().Yellow;
- }
- else
- {
- b1 = getInstanceL2Util().Yellow;
- }
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13080), b0, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13081), b1, "", True, True);
- TargetMannerToggle_BTN.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
- return;
- }
- function Autotarget_NextTargetSetCusomTooltip()
- {
- local int N;
- local Color b0, b1, b2, b3, b4;
- local array<DrawItemInfo> drawListArr;
- local string toolString;
- b0 = getInstanceL2Util().Gray;
- b1 = getInstanceL2Util().Gray;
- b2 = getInstanceL2Util().Gray;
- b3 = getInstanceL2Util().Gray;
- b4 = getInstanceL2Util().Gray;
- TargetNext_BTN.ClearTooltip();
- TargetNext_BTN.SetTooltipType("text");
- N = GetOptionInt("Communication", "NextTargetModeClassic");
- if(N == 0)
- {
- TargetNext_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.L2UI_NewTex.Automaticplay.TargetBTN_threat", "L2UI_NewTex.Automaticplay.TargetBTN_threat_Over", "L2UI_NewTex.Automaticplay.TargetBTN_threat_Down");
- b0 = getInstanceL2Util().Yellow;
- }
- else
- {
- if(N == 1)
- {
- TargetNext_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Over", "L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Normal");
- b2 = getInstanceL2Util().Yellow;
- }
- else
- {
- if(N == 2)
- {
- TargetNext_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.TargetBTN_pc", "L2UI_NewTex.Automaticplay.TargetBTN_pc_Over", "L2UI_NewTex.Automaticplay.TargetBTN_pc_Down");
- b3 = getInstanceL2Util().Yellow;
- }
- else
- {
- if(N == 3)
- {
- TargetNext_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Over", "L2UI_NewTex.AutomaticPlay.TargetBTN_Next_Normal");
- b4 = getInstanceL2Util().Yellow;
- }
- else
- {
- if(N == 4)
- {
- TargetNext_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.L2UI_NewTex.Automaticplay.TargetBTN_threat", "L2UI_NewTex.Automaticplay.TargetBTN_threat_Over", "L2UI_NewTex.Automaticplay.TargetBTN_threat_Down");
- b1 = getInstanceL2Util().Yellow;
- }
- }
- }
- }
- }
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3862), b0, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(13732), b1, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3863), b2, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3864), b3, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemText(GetSystemString(3865), b4, "", True, True);
- drawListArr[drawListArr.Length] = addDrawItemBlank(4);
- drawListArr[drawListArr.Length] = AddCrossLineForCustomToolTip(130);
- drawListArr[drawListArr.Length] = addDrawItemBlank(4);
- toolString = MenuEntireWnd(GetScript("MenuEntireWnd")).setMainShortcutString(MenuEntireWnd(GetScript("MenuEntireWnd")).getAssignedKeyGroup(), "NextTargetModeChange");
- drawListArr[drawListArr.Length] = addDrawItemText(toolString, getInstanceL2Util().White, "", True, True);
- TargetNext_BTN.SetTooltipCustomType(MakeTooltipMultiTextByArray(drawListArr));
- return;
- }
- function OnRButtonUp(WindowHandle a_WindowHandle, int X, int Y)
- {
- switch(a_WindowHandle.GetWindowName())
- {
- case "AutoTargetAll_BTN":
- case "MacroShortcutItem":
- requestAutoPlay(!autotarget_bUseAutoTarget);
- break;
- default:
- break;
- }
- return;
- }
- function bool getUseAutoTarget()
- {
- return autotarget_bUseAutoTarget;
- }
- function Autotarget_OnNext_Target_BTNClick()
- {
- local string strParam;
- local int targetMode;
- strParam = "";
- switch(GetOptionInt("CommunIcation", "NextTargetModeClassic"))
- {
- case 0:
- targetMode = 4;
- break;
- case 1:
- targetMode = 2;
- break;
- case 2:
- targetMode = 3;
- break;
- case 3:
- targetMode = 0;
- break;
- case 4:
- targetMode = 1;
- break;
- default:
- break;
- }
- SetOptionInt("Communication", "NextTargetModeClassic", targetMode);
- ParamAdd(strParam, "NextTargetMode", string(targetMode));
- ExecuteEvent(11030, strParam);
- Autotarget_NextTargetSetCusomTooltip();
- Autotarget_updateNextTargetButton();
- return;
- }
- function Autotarget_OnSwap_Target_BTNClick()
- {
- autotarget_bShortTarget = !autotarget_bShortTarget;
- SetINIBool("AutomaticPlay", "a", !autotarget_bShortTarget, "windowsInfo.ini");
- if(autotarget_bShortTarget)
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(3956));
- }
- else
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(3957));
- }
- Autotarget_SwapTargetSetCusomTooltip();
- Autotarget_updateSwapTargetButton();
- return;
- }
- function Autotarget_TargetMannerToggle_BTNClick()
- {
- autotarget_bIsMannerModeOn = !autotarget_bIsMannerModeOn;
- SetINIBool("AutomaticPlay", "p", autotarget_bIsMannerModeOn, "windowsInfo.ini");
- if(autotarget_bIsMannerModeOn)
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(13080));
- }
- else
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(13081));
- }
- Autotarget_updateMannerModeButton();
- Autotarget_MannerModeSetCusomTooltip();
- return;
- }
- function Autotarget_TargetPickupToggle_BTNClick()
- {
- autotarget_bIsPickupOn = !autotarget_bIsPickupOn;
- SetINIBool("AutomaticPlay", "e", autotarget_bIsPickupOn, "windowsInfo.ini");
- if(autotarget_bIsPickupOn)
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(3993));
- }
- else
- {
- getInstanceL2Util().showGfxScreenMessage(GetSystemString(3992));
- }
- Autotarget_updatePickupButton();
- Autotarget_PickupSetCusomTooltip();
- return;
- }
- function Autotarget_updateSwapTargetButton()
- {
- if(autotarget_bShortTarget)
- {
- TargetSwap_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.TargetBTN_ShotD_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_ShotD_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_ShotD_Over");
- }
- else
- {
- TargetSwap_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.TargetBTN_LongD_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_LongD_Normal", "L2UI_NewTex.AutomaticPlay.TargetBTN_LongD_Over");
- }
- return;
- }
- function Autotarget_updateNextTargetButton()
- {
- return;
- }
- function Autotarget_updatePickupButton()
- {
- if(autotarget_bIsPickupOn)
- {
- TargetPickupToggle_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.GetBTNON_Normal", "L2UI_NewTex.AutomaticPlay.GetBTNON_Normal", "L2UI_NewTex.AutomaticPlay.GetBTNON_Over");
- }
- else
- {
- TargetPickupToggle_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.GetBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.GetBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.GetBTNOff_Over");
- }
- return;
- }
- function Autotarget_updateMannerModeButton()
- {
- if(autotarget_bIsMannerModeOn)
- {
- TargetMannerToggle_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.MannerBTNON_Normal", "L2UI_NewTex.AutomaticPlay.MannerBTNON_Normal", "L2UI_NewTex.AutomaticPlay.MannerBTNON_over");
- }
- else
- {
- TargetMannerToggle_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.MannerBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.MannerBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.MannerBTNOff_over");
- }
- return;
- }
- function Autotarget_updateCombatButton()
- {
- if(nCombatOnOff > 0)
- {
- Combat_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.CombatBTNON_Normal", "L2UI_NewTex.AutomaticPlay.CombatBTNON_Normal", "L2UI_NewTex.AutomaticPlay.CombatBTNON_Over");
- }
- else
- {
- Combat_BTN.SetTexture("L2UI_NewTex.AutomaticPlay.CombatBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.CombatBTNOff_Normal", "L2UI_NewTex.AutomaticPlay.CombatBTNOff_Over");
- }
- return;
- }
- function Autotarget_UpdateAutoTargetState()
- {
- if(autotarget_bUseAutoTarget)
- {
- AnimTexturePlay(AutoTargetAllON_ToggleEffect_Anim, True);
- AnimTexturePlay(AutoTargetAllON_ToggleEffect_Anim2, True);
- GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win").ShowWindow();
- GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllOFF_Win").HideWindow();
- }
- else
- {
- AnimTextureStop(AutoTargetAllON_ToggleEffect_Anim, True);
- AnimTextureStop(AutoTargetAllON_ToggleEffect_Anim2, True);
- GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win").HideWindow();
- GetWindowHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllOFF_Win").ShowWindow();
- }
- YetiQuickSlotwndScript.setPlayAutoTargetActiveAnim();
- return;
- }
- function requestAutoPlay(bool bUseAutoTarget, optional int nHPPotionPercent, optional int nHPPetPotionPercent)
- {
- local AutoplaySettingData pAutoplaySettingData;
- autotarget_nTargetMode = GetNextTargetModeOption();
- pAutoplaySettingData.IsAutoPlayOn = bUseAutoTarget;
- pAutoplaySettingData.IsPickupOn = autotarget_bIsPickupOn;
- pAutoplaySettingData.NextTargetMode = autotarget_nTargetMode;
- pAutoplaySettingData.IsNearTargetMode = autotarget_bShortTarget;
- pAutoplaySettingData.IsMannerModeOn = autotarget_bIsMannerModeOn;
- if(nHPPotionPercent > 0)
- {
- pAutoplaySettingData.HPPotionPercent = nHPPotionPercent;
- }
- else
- {
- pAutoplaySettingData.HPPotionPercent = autotarget_nHPPotionPercent;
- }
- if(nHPPetPotionPercent > 0)
- {
- pAutoplaySettingData.HPPetPotionPercent = nHPPetPotionPercent;
- }
- else
- {
- pAutoplaySettingData.HPPetPotionPercent = autotarget_nHPPetPotionPercent;
- }
- UpdateAutoplaySetting(pAutoplaySettingData);
- return;
- }
- function requestAutoPlayForAutoPotion(int nHPPotionPercent)
- {
- requestAutoPlay(autotarget_bUseAutoTarget, nHPPotionPercent);
- return;
- }
- function requestAutoPlayForAutoPotionPet(int nHPPetPotionPercent)
- {
- requestAutoPlay(autotarget_bUseAutoTarget, autotarget_nHPPotionPercent, nHPPetPotionPercent);
- return;
- }
- function requestAutoPlayForAutoPotionWithPet(int nHPPotionPercent, int nHPPetPotionPercent)
- {
- requestAutoPlay(autotarget_bUseAutoTarget, nHPPotionPercent, nHPPetPotionPercent);
- return;
- }
- function showHideForYeti(bool bShow)
- {
- if(bShow)
- {
- m_hOwnerWnd.ShowWindow();
- }
- else
- {
- m_hOwnerWnd.HideWindow();
- }
- return;
- }
- function WinMinMax()
- {
- if(WinMinBTN.GetButtonValue() == 0)
- {
- SetMin();
- }
- else
- {
- SetMax();
- }
- return;
- }
- private function SetMin()
- {
- SetINIBool("AutomaticPlay", "v", True, "windowsInfo.ini");
- WinMinBTN.SetButtonValue(1);
- WinMinBTN.SetTexture("L2UI_NewTex.AutomaticPlay.WinExpandButton_Normal", "L2UI_NewTex.AutomaticPlay.WinExpandButton_Down", "L2UI_NewTex.AutomaticPlay.WinExpandButton_Over");
- LineBG.SetTexture("");
- AutoCircleFrameExpand.SetTexture("L2UI_NewTex.AutomaticPlay.AutoCircleFrameSmall");
- TargetNext_BTN.HideWindow();
- TargetSwap_BTN.HideWindow();
- TargetPickupToggle_BTN.HideWindow();
- TargetMannerToggle_BTN.HideWindow();
- Combat_BTN.HideWindow();
- return;
- }
- private function SetMax()
- {
- SetINIBool("AutomaticPlay", "v", False, "windowsInfo.ini");
- WinMinBTN.SetButtonValue(0);
- WinMinBTN.SetTexture("L2UI_NewTex.AutomaticPlay.WinMinButton_Normal", "L2UI_NewTex.AutomaticPlay.WinMinButton_Down", "L2UI_NewTex.AutomaticPlay.WinMinButton_Over");
- LineBG.SetTexture("L2UI_NewTex.AutomaticPlay.LineBG");
- AutoCircleFrameExpand.SetTexture("L2UI_NewTex.AutomaticPlay.AutoCircleFrameExpand");
- TargetNext_BTN.ShowWindow();
- TargetSwap_BTN.ShowWindow();
- TargetPickupToggle_BTN.ShowWindow();
- TargetMannerToggle_BTN.ShowWindow();
- Combat_BTN.ShowWindow();
- return;
- }
- private function HandleUpdatePlayerAutoAttacking()
- {
- if(API_IsAutoAttacking())
- {
- GetTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllOFF_Win.AutoAllIcon_Off_texture").SetTexture("L2UI_NewTex.AutomaticPlay.FightOn");
- GetTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win.AutoAllIcon_On_texture").SetTexture("L2UI_NewTex.AutomaticPlay.FightOn_Auto");
- }
- else
- {
- GetTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllOFF_Win.AutoAllIcon_Off_texture").SetTexture("L2UI_NewTex.AutomaticPlay.FightOff");
- GetTextureHandle("AutomaticPlay.AutoTargetWnd.AutoTargetAllON_Win.AutoAllIcon_On_texture").SetTexture("L2UI_NewTex.AutomaticPlay.FightOff_Auto");
- }
- return;
- }
- private function bool API_IsAutoAttacking()
- {
- return Class'UIDATA_PLAYER'.static.IsAutoAttacking();
- }
- function int GetAbs(int Num)
- {
- if(Num < 0)
- {
- return -Num;
- }
- return Num;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement