• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Turning this galaxy script into GUI

Status
Not open for further replies.
Level 2
Joined
Feb 15, 2013
Messages
12
This is me. I had no intention to come back to this site at all, judging by the way SC2 is treated here but since someone knowing galaxy may be able to help and sc2mapster didn't help enough, I had to come for a short time.

This Mod contains custom Action triggers made with galaxy script, one of the actions I need. I do not want to use a whole Mod for that or in a Library (adding the script to Library didn't work anyway), so I want someone to add the Galaxy Script for the action Spin into GUI custom script, so that it is usable as GUI. I need to use just this action

  • Events
  • Conditions
  • Actions
    • Unit - Do/Don't Spin (Unit), set rate (0.01)
This action allows to spin the unit's art model file which I need in cases like making an non-animated Sphere for a Planet or a Moon spin. 0.01 rate is a normal slow speed like Planet Views/Icons have. The owner of the mod is inactive.
 
Level 2
Joined
Feb 15, 2013
Messages
12
Just need the spin trigger out of it into GUI

JASS:
int GAx3_God_Player=0;unit GAx3_God;actorscope GAx3_GodScope=ActorScopeCreate("EmptyScope");actor GAx3_GodActor=ActorFromScope(GAx3_GodScope,"::Main");void GAx3_GodInit(){PlayerCreateEffectPoint(GAx3_God_Player,"GodDescend",Point(0,0));}void GAx3_ResumeXPGaining(){int i=0;Wait(0,c_timeGame);while(i<16){PlayerSetState(i,c_playerStateXPGain,true);i+=1;}}string GAx3_StringSpilt(string s,int n,string sl){int i=1;while(i<n){s=StringSub(s,StringFind(s,sl,true)+1,-1);i+=1;}return StringSub(s,1,StringFind(s,sl,true)-1);}string GAx3_StringSpilt2(string s,int n,string sl){return StringReplaceWord(StringWord(StringReplaceWord(StringReplaceWord(s," ","\r",-1,true),sl," ",-1,true),n),"\r"," ",-1,true);}void GAx3_ActorSendAsyn(playergroup players,actor a,string msg){actor agt=ActorCreate(null,"TriggerPerPlayerActorAgent",null,null,null);actor tar=null;playergroup others=PlayerGroupActive();libNtve_gf_RemovePlayerGroupFromPlayerGroup(players,others);ActorRefSet(agt,"::actor.MsgTarget",a);UIFlyerHelperOverride(players,2);UIFlyerHelperOverride(others,0);ActorSend(agt,"Signal SetTargetActual");UIFlyerHelperClearOverride(PlayerGroupAll());tar=ActorFromActor(agt,"::actor.MsgTargetActual");ActorSend(agt,"Destroy");ActorSend(tar,msg);}void GAx3_ActorShowAsyn(playergroup players,actor a,bool inShow) {if(inShow){GAx3_ActorSendAsyn(players,a,"SetVisibility 1");}else{GAx3_ActorSendAsyn(players,a,"SetVisibility");}}void GAx3_ActorShowAsyn2(playergroup players,actor a,bool inShow) {GAx3_ActorSendAsyn(players,a,"SetVisibility "+IntToString(BoolToInt(inShow)));}void GAx3_ActorDestroyAsyn(playergroup players,actor a, bool immediate) {if(immediate){GAx3_ActorSendAsyn(players,a,"Destroy Immediate");}else {GAx3_ActorSendAsyn(players,a,"Destroy");}}void GAx3_ActorRegionSendAsyn(playergroup players,actor a,int intersect,string msg,string filters,string terms){playergroup others=PlayerGroupActive();terms="FlyerHelper All;"+terms;libNtve_gf_RemovePlayerGroupFromPlayerGroup(players,others);UIFlyerHelperOverride(players,2);UIFlyerHelperOverride(others,0);ActorRegionSend(a,intersect,msg,filters,terms);UIFlyerHelperClearOverride(PlayerGroupAll());}void GAx3_ActorRegionSendSimpleAsyn(playergroup players,actor a,string msg){GAx3_ActorRegionSendAsyn(players,a,c_actorIntersectAgainstRadiusContact,msg,null,null);}void GAx3_ActorSendToGameRegionSimpleAsyn(playergroup players,region r,string msg){actor a=ActorRegionCreate(null,"TriggerRegion",r);GAx3_ActorRegionSendAsyn(players,a,c_actorIntersectAgainstRadiusContact,msg,null,null);ActorSend(a,"Destroy");}void GAx3_ActorSendToGameRegionAsyn(playergroup players,region r,int intersect,string msg,string filters,string terms){actor a=ActorRegionCreate(null,"TriggerRegion",r);GAx3_ActorRegionSendAsyn(players,a,intersect,msg,filters,terms);ActorSend(a,"Destroy");}void GAx3_TriggerAddEventUnitAnyAbility(trigger t,unitref u,int stage,bool includeSharedAbils){TriggerAddEventUnitAbility(t,u,AbilityCommand("",255),stage,includeSharedAbils);}actor GAx3_BeamCreate(string inModelLink,actor from,actor to){actorscope as=ActorScopeFromActor(from);from=ActorFromActor(from,"::Supporter");to=ActorFromActor(to,"::Supporter");ActorScopeRefSet(as,"::scope.BeamFrom",from);ActorScopeRefSet(as,"::scope.BeamTo",to);return ActorCreate(as,"BeamSimple",inModelLink,"::scope.BeamFrom","::scope.BeamTo");}actor GAx3_ActorSiteFromActorAttach(actor a,string inAttachment){actorscope as=ActorScopeFromActor(a);ActorScopeRefSet(as,"::scope.TriggerSiteHost",a);ActorSend(a,"Create TriggerSite {"+inAttachment+"}");return ActorFromScope(as,"::LastCreatedActual");}actor GAx3_ActorSiteFromPoint(point p){actor a;ActorSend(GAx3_GodActor,"Create TriggerSiteNoHarness");a=ActorFromScope(GAx3_GodScope,"::LastCreatedActual");ActorSend(a,"SetPositionH "+FixedToString(PointGetX(p),6)+","+FixedToString(PointGetY(p),6)+" "+FixedToString(PointGetHeight(p),6));ActorScopeRefSet(GAx3_GodScope,"scope.TriggerSiteHost",a);return a;}void GAx3_ActorSiteDestroy(actor a){ActorSend(a,"Destroy");}void GAx3_ActorSetPosition(actor a,actor site){ActorRefSet(a,"::actor.Position",site);ActorSend(a,"SetPositionFrom ::actor.Position");}void GAx3_ActorMove(actor a,fixed s,actor des){actorscope as=ActorScopeFromActor(a);actor m=ActorCreate(as,"TriggerMover",null,null,null);GAx3_ActorSetPosition(m,a);ActorRefSet(a,"::Host",m);ActorSend(ActorFromActor(a,"::actor.Mover"),"Destroy");ActorRefSet(a,"::actor.Mover",m);ActorRefSet(m,"::actor.Des",des);ActorSend(m,"MoverSetDestinationFrom ::actor.Des");ActorSend(m,"MoverSetSpeed "+FixedToString(s,6));ActorSend(m,"MoverMove");}void GAx3_ActorMoveStop(actor a,bool allowDe){if(allowDe){ActorSend(ActorFromActor(a,"::Host"),"MoverStop");}else{ActorSend(ActorFromActor(a,"::Host"),"MoverStopNow");}}void GAx3_ActorSetSpeed(actor a,fixed ac,fixed de,fixed s,fixed ms){actor m=ActorFromActor(a,"::Host");ActorSend(m,"MoverSetSpeedMax "+FixedToString(ms,6));ActorSend(m,"MoverSetSpeed "+FixedToString(s,6));ActorSend(m,"MoverSetAcceleration "+FixedToString(ac,6));ActorSend(m,"MoverSetDeceleration "+FixedToString(de,6));}void GAx3_ActorAttach(actor h,actor a,string inAttachment){actorscope as=ActorScopeFromActor(h);ActorScopeRefSet(as,"::scope.TriggerSiteHost",h);ActorRefSet(a,"::Host",ActorCreate(as,"TriggerSite",inAttachment,null,null));}void GAx3_ActorAttachNewTo(actor h,string inActorLink,string inAttachment){actorscope as=ActorScopeFromActor(h);ActorScopeRefSet(as,"::scope.TriggerSiteHost",h);ActorRefSet(ActorCreate(as,inActorLink,null,null,null),"::Host",ActorCreate(as,"TriggerSite",inAttachment,null,null));}void GAx3_ActorAttachNewModelTo(actor h,string inModelLink,string inAttachment){actorscope as=ActorScopeFromActor(h);ActorScopeRefSet(as,"::scope.TriggerSiteHost",h);ActorRefSet(ActorCreate(as,"ModelHosted",inModelLink,null,null),"::Host",ActorCreate(as,"TriggerSite",inAttachment,null,null));}void GAx3_ActorDetach(actor a){actor site=ActorCreate(null,"TriggerSite",null,null,null);  GAx3_ActorSetPosition(site,a);ActorSend(ActorFromActor(a,"::Host"),"Signal Recycle");ActorRefSet(a,"::Host",null);GAx3_ActorSetPosition(a,site);ActorSend(site,"Destroy");}void GAx3_ActorForceDetach(actor a){actor site=ActorCreate(null,"TriggerSiteNoHarness",null,null,null);  GAx3_ActorSetPosition(site,a);ActorSend(ActorFromActor(a,"::Host"),"Signal Recycle");ActorRefSet(a,"::Host",site);}void GAx3_BeamSetPosition(actor a,string endpoint,actor site){ActorRefSet(a,endpoint,ActorFromActor(site,"::Supporter"));}void GAx3_BeamMove(actor a,string endpoint,fixed s,actor site){GAx3_ActorMove(ActorFromActor(a,endpoint),s,site);}void GAx3_BeamMoveStop(actor a,string endpoint,bool allowDe){GAx3_ActorMoveStop(ActorFromActor(a,endpoint),allowDe);}void GAx3_BeamSetSpeed(actor a,string endpoint,fixed ac,fixed de,fixed s,fixed ms){GAx3_ActorSetSpeed(ActorFromActor(a,endpoint),ac,de,s,ms);}void GAx3_ActorMessageModelSwap(actor a,string inModelLink,int var){ActorSend(a,"ModelSwap "+inModelLink+" "+IntToString(var));}void GAx3_ActorCastShadow(actor a,bool inShow) {ActorSend(a,"SetCastShadows "+IntToString(BoolToInt(inShow)));}void GAx3_UnitSpinSet(unit u,bool spin,fixed spinRate){actorscope as=ActorScopeFromUnit(u);actor a=ActorFromScope(as,"::Main");actor sp;ActorScopeSend(as,"Signal RecycleSpin");if(spin){sp=ActorCreate(as,"ModelSpin",null,null,null);ActorSend(sp,"AnimSetTimeScaleGlobal "+FixedToString(spinRate,6)); GAx3_ActorAttach(sp,a,"Origin");}else{GAx3_ActorDetach(a);}}int GAx3_ModelGlossaryCreate(int offsetX,int offsetY,int anchor,int width,int height,string modelLink,string cameraLink,bool spin,fixed spinRate,string animProps,bool visible,bool waitUntilLoaded){int p=PortraitCreate(offsetX,offsetY,anchor,width,height,"Star2Camera",cameraLink,"Stand",visible,waitUntilLoaded);actorscope as=ActorScopeFromPortrait(p);actor sp=ActorCreate(as,"PortraitSpin",null,null,null);actor a=ActorCreate(as,"GlossaryModel",null,null,null);if(cameraLink=="PlanetPanelCamera"||cameraLink=="TechPurchaseCamera"||cameraLink=="UnitGlossaryCamera"){cameraLink=CatalogFieldValueGet(c_gameCatalogModel,modelLink,cameraLink,-1);PortraitSetCamera(p,cameraLink);}ActorSend(a,"ModelSwap "+modelLink);ActorSend(a,"AnimPlay TriggerPortraitAnim "+StringReplaceWord(animProps," ",",",-1,true));ActorScopeRefSet(as,"::scope.Model",a);ActorScopeRefSet(as,"::scope.Spin",sp);if(spin){ActorSend(sp,"AnimSetTimeScaleGlobal "+FixedToString(spinRate,6)); ActorRefSet(a,"::Host",sp);}return p;}actor GAx3_ActorFromGlossary(int p){return ActorFromScope(ActorScopeFromPortrait(p),"::scope.Model");}void GAx3_GlossarySpinEnable(int p,bool spin,fixed spinRate){actorscope as=ActorScopeFromPortrait(p);actor a=GAx3_ActorFromGlossary(p);actor sp=ActorFromScope(as,"::scope.Spin");if(spin){ActorSend(sp,"AnimSetTimeScaleGlobal "+FixedToString(spinRate,6)); ActorRefSet(a,"::Host",sp);}else{ActorRefSet(a,"::Host",null);}}void GAx3_UnitSetCustomValueEx(unit u,string att,fixed val){string link ="GAx3_"+att;libNtve_gf_UnitRemoveChargeUsed(u,link);UnitAddChargeUsed(u,link,val);}fixed GAx3_UnitGetCustomValueEx(unit u,string att){string link="GAx3_"+att;return UnitGetChargeUsed(u,link);}fixed GAx3_MaxHandleID=0;int GAx3_UnitGetHandle(unit u){fixed val=GAx3_UnitGetCustomValueEx(u,"Internal_Handle");if(val<0.5){GAx3_MaxHandleID+=1;val=GAx3_MaxHandleID;GAx3_UnitSetCustomValueEx(u,"Internal_Handle",val);}return FixedToInt(val);}void GAx3_UnitAddXP(unit u,fixed xp){xp+=UnitXPTotal(u);UnitSetPropertyFixed(u,c_unitPropXP,xp);}void GAx3_UnitSetXP(unit u,fixed xp){UnitSetPropertyFixed(u,c_unitPropXP,xp);}string GAx3_UnitInventoryGet(unit u){int i=1;int c=UnitAbilityCount(u);string abil;string s="";while (i<=c){abil=UnitAbilityGet(u,i);if(AbilityClass(abil)==c_classIdCAbilInventory){s=abil;break;}}return s;}void GAx3_UnitInventoryEnable(unit u,bool inEnable){UnitAbilityEnable(u,GAx3_UnitInventoryGet(u),inEnable);}bool GAx3_UnitIssueItemOrderTargetNone(unit u,int inCmdIndex,unit inItem,int inQueueType){string abil=GAx3_UnitInventoryGet(u);order ord=OrderTargetingItem(AbilityCommand(abil,inCmdIndex),inItem);return UnitIssueOrder(u,ord,inQueueType);}bool GAx3_UnitIssueItemOrderTargetPoint(unit u,int inCmdIndex,unit inItem,point inPoint,int inQueueType){string abil=GAx3_UnitInventoryGet(u);order ord=OrderTargetingItem(AbilityCommand(abil,inCmdIndex),inItem);OrderSetTargetPoint(ord,inPoint);return UnitIssueOrder(u,ord,inQueueType);}bool GAx3_UnitIssueItemOrderTargetUnit(unit u,int inCmdIndex,unit inItem,unit inUnit,int inQueueType){string abil=GAx3_UnitInventoryGet(u);order ord=OrderTargetingItem(AbilityCommand(abil,inCmdIndex),inItem);OrderSetTargetUnit(ord,inUnit);return UnitIssueOrder(u,ord,inQueueType);}bool GAx3_UnitInventoryGiveItem(unit u,unit inItem){point fallbackPoint=UnitGetPosition(inItem);GAx3_UnitIssueItemOrderTargetUnit(GAx3_God,c_abilInventoryCmdTake,inItem,inItem,c_orderQueueReplace);GAx3_UnitIssueItemOrderTargetUnit(GAx3_God,c_abilInventoryCmdDrop,inItem,u,c_orderQueueAddToEnd);if(UnitInventoryUnit(inItem)==GAx3_God){GAx3_UnitIssueItemOrderTargetPoint(GAx3_God,c_abilInventoryCmdDrop,inItem,fallbackPoint,c_orderQueueReplace);return false;}return true;}bool GAx3_UnitIssuePawnOrderForPlayer(unit u,unit inItem,unit shop,int inPlayer,int inQueueType){string abil=GAx3_UnitInventoryGet(u);order ord=OrderTargetingItem(AbilityCommand(abil,c_abilInventoryCmdDrop),inItem);OrderSetTargetUnit(ord,shop);OrderSetPlayer(ord,inPlayer);return UnitIssueOrder(u,ord,inQueueType);    }bool GAx3_UnitIssueOrderForPlayer(unit u,order inOrder,int inPlayer,int inQueueType){OrderSetPlayer(inOrder,inPlayer);return UnitIssueOrder(u,inOrder,inQueueType);    }string GAx3_ItemGetType(unit inItem){return CatalogFieldValueGet(c_gameCatalogUnit,(UnitGetType(inItem)),"Item",c_playerAny);}string GAx3_ItemGetChargeLink(unit inItem){string scope;string itemType=GAx3_ItemGetType(inItem);string link="";string abil;if (CatalogEntryIsValid(c_gameCatalogItem,itemType)) {scope=CatalogEntryScope(c_gameCatalogItem,itemType);if((scope=="CItemEffectInstant")||(scope=="CItemEffectTarget")){link=CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Charge.Link",c_playerAny);}else if(scope=="CItemAbil"){abil=CatalogFieldValueGet(c_gameCatalogItem,itemType,"Abil",c_playerAny);link =CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Charge.Link",c_playerAny);}}return link;}string GAx3_ItemGetCooldownLink(unit inItem){string scope;string itemType=GAx3_ItemGetType(inItem);string link="";string abil;if (CatalogEntryIsValid(c_gameCatalogItem,itemType)) {scope=CatalogEntryScope(c_gameCatalogItem,itemType);if((scope=="CItemEffectInstant")||(scope=="CItemEffectTarget")){link=CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Cooldown.Link",c_playerAny);}else if(scope=="CItemAbil"){abil=CatalogFieldValueGet(c_gameCatalogItem,itemType,"Abil",c_playerAny);link =CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Cooldown.Link",c_playerAny);}}return link;}void GAx3_ItemAddChargeUsed(unit inItem,fixed inVal){UnitAddChargeUsed(inItem,GAx3_ItemGetChargeLink(inItem),inVal);}fixed GAx3_ItemGetChargeUsed(unit inItem){return UnitGetChargeUsed(inItem,GAx3_ItemGetChargeLink(inItem));}void GAx3_ItemSetChargeRemain(unit inItem,fixed inVal){string scope;string itemType=GAx3_ItemGetType(inItem);string link="";string abil;fixed max;if (CatalogEntryIsValid(c_gameCatalogItem,itemType)) {scope=CatalogEntryScope(c_gameCatalogItem,itemType);if((scope=="CItemEffectInstant")||(scope=="CItemEffectTarget")){link=CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Charge.Link",c_playerAny);max=StringToFixed(CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Charge.CountMax",c_playerAny));}else if(scope=="CItemAbil"){abil=CatalogFieldValueGet(c_gameCatalogItem,itemType,"Abil",c_playerAny);link =CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Charge.Link",c_playerAny);max=StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Charge.CountMax",c_playerAny));}UnitAddChargeUsed(inItem,link,max-inVal-UnitGetChargeUsed(inItem,link));}}fixed GAx3_ItemGetChargeRemain(unit inItem){string scope;string itemType=GAx3_ItemGetType(inItem);string link="";string abil;fixed max;if (CatalogEntryIsValid(c_gameCatalogItem,itemType)) {scope=CatalogEntryScope(c_gameCatalogItem,itemType);if((scope=="CItemEffectInstant")||(scope=="CItemEffectTarget")){link=CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Charge.Link",c_playerAny);max=StringToFixed(CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost.Charge.CountMax",c_playerAny));}else if(scope=="CItemAbil"){abil=CatalogFieldValueGet(c_gameCatalogItem,itemType,"Abil",c_playerAny);link =CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Charge.Link",c_playerAny);max=StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0].Charge.CountMax",c_playerAny));}return max-UnitGetChargeUsed(inItem,link);}return 0;}void GAx3_ItemAddChargeRegen(unit inItem,fixed inVal){UnitAddChargeRegen(inItem,GAx3_ItemGetChargeLink(inItem),inVal);}fixed GAx3_ItemGetChargeRegen(unit inItem){return UnitGetChargeRegen(inItem,GAx3_ItemGetChargeLink(inItem));}const int c_GAx3_ChargeCountStart=5;const int c_GAx3_ChargeRegenStart=6;fixed GAx3_ItemChargeInfo(unit inItem,int inType){string scope;string itemType;string abil;string path;fixed val;if(inType==c_unitAbilChargeCountLeft){return GAx3_ItemGetChargeRemain(inItem);}else if(inType==c_unitAbilChargeRegenLeft){return GAx3_ItemGetChargeRegen(inItem);}else{itemType=GAx3_ItemGetType(inItem);if (CatalogEntryIsValid(c_gameCatalogItem,itemType)) {if(inType==c_unitAbilChargeCountMax){path="Charge.CountMax";}else if(inType==c_unitAbilChargeCountUse){path="Charge.CountUse";}else if(inType==c_GAx3_ChargeCountStart){path="Charge.CountStart";}else if(inType==c_unitAbilChargeRegenMax){path="Charge.TimeUse";}else if(inType==c_GAx3_ChargeRegenStart){path="Charge.TimeStart";}scope=CatalogEntryScope(c_gameCatalogItem,itemType);if((scope=="CItemEffectInstant")||(scope=="CItemEffectTarget")){val=StringToFixed(CatalogFieldValueGet(c_gameCatalogItem,itemType,"EffectCost."+path,c_playerAny));}else if(scope=="CItemAbil"){abil=CatalogFieldValueGet(c_gameCatalogItem,itemType,"Abil",c_playerAny);val=StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil,abil,"Cost[0]."+path,c_playerAny));}return val;}}return 0;}void GAx3_ItemAddCooldown(unit inItem,fixed inVal){UnitAddCooldown(inItem,GAx3_ItemGetCooldownLink(inItem),inVal);}fixed GAx3_ItemGetCooldown(unit inItem){return UnitGetCooldown(inItem,GAx3_ItemGetCooldownLink(inItem));}trigger GAx3_tGodDescend=TriggerCreate("libGAx3_GodDescend");bool libGAx3_GodDescend(bool testConds, bool runActions){GAx3_God=EventPlayerEffectUsedUnit(c_effectUnitTarget);GAx3_God_Player=UnitGetOwner(GAx3_God);UnitSetState(GAx3_God, c_unitStateHidden, true);UnitSetPropertyFixed(GAx3_God, c_unitPropLifeMax, 0.0);return true;}trigger GAx3_tDamageAmountSendN=TriggerCreate("libGAx3_DamageAmountSendN");bool libGAx3_DamageAmountSendN(bool testConds, bool runActions){string s=FixedToString(EventUnitDamageAmount(),0);actor a=libNtve_gf_MainActorofUnit(EventUnit());TriggerEnable(GAx3_tDamageAmountSendN,false);ActorSend(a,"Create CritText");ActorSendTo(a,"::LastCreatedActual","SetText "+s);return true;}trigger GAx3_tDamageAmountSendS=TriggerCreate("libGAx3_DamageAmountSendS");bool libGAx3_DamageAmountSendS(bool testConds, bool runActions){string s=FixedToString(EventUnitDamageAmount(),0);actor a=libNtve_gf_MainActorofUnit(EventUnit());TriggerEnable(GAx3_tDamageAmountSendS,false);ActorSend(a,"Create CritTextSpell");ActorSendTo(a,"::LastCreatedActual","SetText "+s);return true;}unit GAx3_registeredDamageTarget;trigger GAx3_tPredamageRegisterN=TriggerCreate("libGAx3_PredamageRegisterN");bool libGAx3_PredamageRegisterN(bool testConds, bool runActions) {GAx3_registeredDamageTarget=EventPlayerEffectUsedUnit(c_effectUnitTarget);TriggerEnable(GAx3_tDamageAmountSendN, true);return true;}trigger GAx3_tPredamageRegisterS=TriggerCreate("libGAx3_PredamageRegisterS");bool libGAx3_PredamageRegisterS(bool testConds, bool runActions) {GAx3_registeredDamageTarget=EventPlayerEffectUsedUnit(c_effectUnitTarget);TriggerEnable(GAx3_tDamageAmountSendS, true);return true;}void GAx3_CritStrikeTextTagShow(bool showNormal, bool showSpell) {TriggerEnable(GAx3_tPredamageRegisterN, showNormal);TriggerEnable(GAx3_tPredamageRegisterS, showSpell);}
text GAx3_PointToText(point p){
    string s="("+FixedToString(PointGetX(p),1)+", "+FixedToString(PointGetY(p),1)+")";
    return StringToText(s);
}
text GAx3_PointToText3D(point p){
    string s="("+FixedToString(PointGetX(p),1)+", "+FixedToString(PointGetY(p),1)+", "+FixedToString(PointGetHeight(p),1)+")";
    return StringToText(s);
}
actor GAx3_ActorCodePhasing(playergroup players,actor a,actor tar){
    actor agt=ActorCreate(null,"TriggerPerPlayerActorAgent",null,null,null);
    playergroup others=PlayerGroupActive();
    libNtve_gf_RemovePlayerGroupFromPlayerGroup(players,others);
    ActorRefSet(agt,"::actor.MsgTarget",a);
    ActorRefSet(agt,"::actor.MsgTargetActual",tar);
    UIFlyerHelperOverride(players,2);
    UIFlyerHelperOverride(others,0);
    ActorSend(agt,"Signal SetTargetActual");
    UIFlyerHelperClearOverride(PlayerGroupAll());
    tar=ActorFromActor(agt,"::actor.MsgTargetActual");
    ActorSend(agt,"Destroy");
    return tar;
}
actor GAx3_LastPersistPhasing;
void GAx3_PersistRegionPhasing(playergroup players,region r){
    actor ar=ActorRegionCreate(null,"TriggerRegion",r);
    GAx3_LastPersistPhasing=GAx3_ActorCodePhasing(players,ar,null);
    ActorSend(GAx3_LastPersistPhasing,"QueryPersistent PersistPhasingResponseEnter PersistPhasingResponseLeave AgainstRadiusContact");
    ar=GAx3_ActorCodePhasing(players,null,ar);
    ActorSend(ar,"Destroy");
}
actor GAx3_LastCreatedPersistPhasing(){
    return GAx3_LastPersistPhasing;
}
void GAx3_HeroIconIncapacitatedSet(unit u,bool Incapacitated){
    actorscope as=ActorScopeFromUnit(u);
    string msg="UIStatusFlagSet";
    if(Incapacitated){msg="UIStatusFlagSet Incapacitated 1";}
    ActorScopeSend(as,msg);
}
void GAx3_OrderQueueClear(unit u,bool wait){
    UnitIssueOrder(u,Order(AbilityCommand("stop",0)),c_orderQueueReplace);
    if(UnitOrderCount(u)){
    PlayerCreateEffectUnit(GAx3_God_Player,"ClearOrderQueue",u);
    if(wait){Wait(0,c_timeGame);}
    }
}
void GAx3_OrderQueueClearExceptCurrent(unit u){
    order ord=UnitOrder(u,0);
    if(ord){
        OrderSetFlag(ord,c_cmdQueued,false);
        UnitIssueOrder(u,ord,c_orderQueueReplace);
    }
}
void GAx3_OrderQueueInsertAt(unit u,int index,order ord){
    order[255] ordQue;
    int i=0;
    int j=0;
    int c=UnitOrderCount(u);
    if(!UnitOrderIsValid(u,ord)){return;}
    if(index>c||index<0){index=c;}
    while(i<=c){
        if(i==index){i+=1;continue;};
        ordQue[i]=UnitOrder(u,j);
        i+=1;j+=1;
    }
    ordQue[index]=ord;
    if(ordQue[0]){
        OrderSetFlag(ordQue[0],c_cmdQueued,false);
        UnitIssueOrder(u,ordQue[0],c_orderQueueReplace);
        i=1;
        while(i<=c){
            UnitIssueOrder(u,ordQue[i],c_orderQueueAddToEnd);
            i+=1;
        }
    }
}
void GAx3_OrderQueueRemoveAt(unit u,int index){
    order[255] ordQue;
    int i=0;
    int c=UnitOrderCount(u);
    if(index>=c||index<0){return;}
    while(i<c){
        ordQue[i]=UnitOrder(u,i);
        i+=1;
    }
    ordQue[index]=null;
    if(index){OrderSetFlag(ordQue[0],c_cmdQueued,false);}
    else{GAx3_OrderQueueClear(u,true);}
    UnitIssueOrder(u,ordQue[0],c_orderQueueReplace);
    i=1;
    while(i<c){
        UnitIssueOrder(u,ordQue[i],c_orderQueueAddToEnd);
        i+=1;
    }
}
bool GAx3_Cheat(string cheat,int player){
    return ConsoleCommand((cheat+" "+IntToString(player)),true,true);
}
bool GAx3_CheatGod(int player){
    return GAx3_Cheat("TerribleTerribleDamage",player);
}
bool GAx3_CheatFastBuild(int player){
    return GAx3_Cheat("CatFoodForPrawnGuns",player);
}
bool GAx3_CheatFood(int player){
    return GAx3_Cheat("Bunker55AliveInside",player);
}
bool[16] GAx3_MultiplayerCheatAllowed;
trigger GAx3_tMultiplayerCheat=TriggerCreate("libGAx3_MultiplayerCheat");
bool libGAx3_MultiplayerCheat(bool testConds, bool runActions) {
	int player=EventPlayer();
	if(GAx3_MultiplayerCheatAllowed[player]){
		GAx3_Cheat(EventChatMessage(false),player);
		return true;
	}else{
		return false;
	}
}
void GAx3_MultiplayerCheatEnable(bool enable,int player){
    GAx3_MultiplayerCheatAllowed[player]=enable;
}
int GAx3_Main(){TriggerAddEventChatMessage(GAx3_tMultiplayerCheat,c_playerAny,"", false);TriggerAddEventPlayerEffectUsed(GAx3_tGodDescend,c_playerAny,"GodTriggerNotify");GAx3_GodInit();TriggerEnable(GAx3_tDamageAmountSendN,false);TriggerEnable(GAx3_tDamageAmountSendS,false);TriggerAddEventPlayerEffectUsed(GAx3_tPredamageRegisterN,c_playerAny,"TakeCritDamageOnce");TriggerAddEventPlayerEffectUsed(GAx3_tPredamageRegisterS,c_playerAny,"TakeCritDamageOnceSpell");TriggerAddEventUnitDamaged(GAx3_tDamageAmountSendN, UnitRefFromVariable("GAx3_registeredDamageTarget"),c_unitDamageTypeAny,c_unitDamageEither,null);TriggerAddEventUnitDamaged(GAx3_tDamageAmountSendS, UnitRefFromVariable("GAx3_registeredDamageTarget"),c_unitDamageTypeAny,c_unitDamageEither,null);TriggerDebugOutput(0,StringExternal("GAx3/LibInfo"),false);return 1;}int GAx3_iMain=GAx3_Main();string GAx3_Fix_SetRotation(fixed lp_forwardX,fixed lp_forwardY,fixed lp_forwardZ,fixed lp_upX,fixed lp_upY,fixed lp_upZ){return libNtve_gf_ActorMsg1("SetRotation",(libNtve_gf_Convert3DVectorToString(lp_forwardX,lp_forwardY,lp_forwardZ)+" "+libNtve_gf_Convert3DVectorToString(lp_upX,lp_upY,lp_upZ)));}
 
Status
Not open for further replies.
Top