| 10-18-2005, 08:06 PM | #1 |
Ok, i've been working on a ANTI TP trigger which is supposed to remove all units that were teleported when a player teleports into an allies base and then unallies using either Town Hall Teleport or Mass Teleport. I originatly came up with this Trigger JASS:Anti Tp2(ITEM) Events Unit - A unit Uses an item Conditions (Item-type of (Item being manipulated)) Equal to Scroll of Town Portal Actions Set OwnerTP = (Owner of (Hero manipulating item)) Set VictimTP = (Owner of (Target unit of ability being cast)) Set CasterTP = (Hero manipulating item) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Owner of (Target unit of ability being cast)) Equal to (Owner of (Hero manipulating item)) Then - Actions Do nothing Else - Actions Wait until (TpDecided Equal to True), checking every 1.00 seconds If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (OwnerTP is giving VictimTP Alliance (non-aggression)) Equal to False Then - Actions Set TempPoint = (Position of (Hero manipulating item)) Set TempUnitGroup = (Units within 700.00 of TempPoint matching (((Matching unit) is in (Units owned by OwnerTP)) Equal to True)) Unit Group - Pick every unit in TempUnitGroup and do (Unit - Remove (Picked unit) from the game) Custom script: call DestroyGroup(udg_TempUnitGroup) Custom script: call RemoveLocation(udg_TempPoint) Game - Display to (All players) for 30.00 seconds the text: Anti Tp has removed... Game - Display to (All players) for 30.00 seconds the text: Read |cff32cd32Fair... Trigger - Turn off DecideTp2 <gen> Trigger - Turn on DecideTp2 <gen> Trigger - Turn off PlayerTp2 <gen> Trigger - Turn on PlayerTp2 <gen> Set TpDecided = False Else - Actions Trigger - Turn off PlayerTp2 <gen> Trigger - Turn on PlayerTp2 <gen> Trigger - Turn off DecideTp2 <gen> Trigger - Turn on DecideTp2 <gen> Set TpDecided = False JASS:PlayerTp2 Events Unit - A unit Uses an item Conditions (Item-type of (Item being manipulated)) Equal to Scroll of Town Portal Actions Wait until ((OwnerTP is an enemy of VictimTP) Equal to True), checking every 1.00 seconds Set TpDecided = True JASS:DecideTp2 Events Unit - A unit Uses an item Conditions (Item-type of (Item being manipulated)) Equal to Scroll of Town Portal Actions Wait 120.00 game-time seconds Set TpDecided = True And it worked for Mass Teleport, but did not work for Town hall teleport and crashed often. Gandolf came up with a trigger also but when I tried it it didn't work and crashed: http://www.wc3campaigns.com/thread_view.php?t=77714 Gandolf's Trigger JASS:Variables -ownerTP as Player -victimTP as Player -casterTP as Player -unitGroupTP as Unit Group -DistanceReal as Real -DistanceUnit as Unit JASS:TPed (<---hmmm, coincidence? i think not) -Events --A Unit Uses an Item -Conditions --(Item Type of (Item being manipulated) = Town Portal -Actions --Custom Script: local player udg_OwnerTP --Custom Script: local player udg_victimTP --Custom Script: local unit udg_casterTP --Custom Script: local group udg_unitGroupTP --Custom Script: local real udg_DistanceReal --Custom Script: local unit udg_DistanceUnit --Set ownerTP = (Owner of (Hero Manipulating Item)) --Set DistanceReal = 701.00 --Pick Every Unit within (700.00) of (Casting Unit) matching (Owner of (Matching Unit) does not = ownerTP) and do (Actions) ---Actions ----If/Then/Else -----Conditions ------Math - Distance from (Position of (Casting Unit)) to (Position of (Picked Unit)) < DistanceReal -----Actions ------Set DistanceReal = (Math - Distance from (Position of (Casting Unit)) to (Position of (Picked Unit)) ------Set DistanceUnit = Picked Unit --Set victimTP = (Owner of (DistanceUnit)) --Set casterTP = Hero Manipulating Item --Pick Every Unit within (700.00) of casterTP and matching condition (Owner of (Matching)) = ownerTP ---Actions ----Unit Group - Add (Picked Unit) to unitGroupTP --Wait for Condition ((ownerTP[Player Number of (ownerTP)] is an Enemy of victimTP[Player Number of(OwnerTP)] = True) Checking every 1.00 seconds --Unit Group - Pick every unit in (Units within 700.00 of Unit - Position of (casterTP) matching (((Matching unit) is in (Units owned by OwnerTP[Player Number of (Owner of TP)])) Equal to True)) and do (Unit - Remove (Picked unit) from the game) --ownerTP = No Player --victimTP = No Player --casterTP = No Unit --unitGroupTP = No Unit Group Also could not do player number of variable because that would be endless. |
| 10-19-2005, 03:26 PM | #2 |
You want to remove any unit that's teleported? Does that make any sense? I think that you would be more interested into a way to stop a unit from using the teleport or block the spell itself instead of removing teleported units?. And if you really need to move the teleported units you can just use a new spell based from channel instead and do it yourself, easier than trying to detect a spell |
| 10-19-2005, 08:09 PM | #3 |
double posted, accident :( |
| 10-19-2005, 08:19 PM | #4 | |
Quote:
|
| 10-20-2005, 12:07 AM | #5 |
Shouldn't you just disable alliance changing during the period of TP? |
| 10-20-2005, 08:05 PM | #6 |
No, that wouldn't work right. I dont want to prevent it either, I want to punish. Besides I can't think of a good way to prevent it actually. |
| 10-20-2005, 09:49 PM | #7 |
I was reluctant to read huge amounts of GUI lines at the start anyways, there is no (Casting unit) on the item is used event |
| 10-22-2005, 03:23 PM | #8 |
(Casting Unit) Does not work, the whole trigger is bad anyway cause even if it did work it would crash. |
| 10-22-2005, 10:43 PM | #9 |
I actually mean that you shouldn't be using Casting Unit but Triggering Unit there |
| 10-24-2005, 02:16 AM | #10 |
Never thought of using triggering unit, but it would crash anyway, could you give me some tips on what not to do so it wont crash. |
| 10-24-2005, 02:18 AM | #11 |
Lord Vexorian, that wait one minute thing is making me double post(cause im impatient). Sorry for double posting. |
| 10-24-2005, 02:28 PM | #12 |
I really don't know, it is a huge GUI trigger, the only thing I would do would be making my own teleport spells instead of trying to detect them correctly |
| 10-24-2005, 08:28 PM | #13 |
I want it to be the normal item town hall teleport. Lord Vexorian, how would you do something like this in jass if you wouldn't in GUI? |
| 10-28-2005, 09:16 PM | #14 |
After Months of on and off working on this trigger, it finally works. |
