mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-19 10:03:01 -04:00
Adjusted to check if ITV has already been learned
Idea from tyrones PR https://github.com/SWG-Source/dsrc/pull/77
This commit is contained in:
@@ -7,3 +7,4 @@ tcg_itv_home callforsolarsailerpickup
|
||||
tcg_itv_location callforg9riggerpickup
|
||||
itv_snowspeeder callforsnowspeeder
|
||||
itv_slave_1 callforslave1pickup
|
||||
default_itv callforpickup
|
||||
|
||||
+1
@@ -7,3 +7,4 @@
|
||||
sharedTemplate = "object/tangible/veteran_reward/shared_instant_travel_terminal.iff"
|
||||
scripts = ["systems.veteran_reward.instant_travel_terminal_deed", "item.special.nomove"]
|
||||
persistByDefault = true
|
||||
objvars = +["default_itv" = 1]
|
||||
|
||||
+5
-2
@@ -30,16 +30,19 @@ public class instant_travel_terminal_deed extends script.base_script
|
||||
sendSystemMessage(player, "Instant Travel vehicles may not be used until you have reached level " + minLevelSetting + ". Please use this deed again when you reach level " + minLevelSetting + " or higher.", null);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
// Make sure the default_itv is always at the bottom of the table else you will get false hits
|
||||
int rows = dataTableGetNumRows(ITV_COMMAND_TABLE);
|
||||
for (int i=0;i<rows;i++) {
|
||||
if (hasObjVar(self, dataTableGetString(ITV_COMMAND_TABLE, i, 0))) {
|
||||
if (hasCommand(player,dataTableGetString(ITV_COMMAND_TABLE, i, 1))) {
|
||||
sendSystemMessageTestingOnly(player, "You have already used this item.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
grantCommand(player, dataTableGetString(ITV_COMMAND_TABLE, i, 1));
|
||||
destroyObject(self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
grantCommand(player, "callforpickup");
|
||||
destroyObject(self);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user