From db074b0a8788a3436e707c2231d889572edb8ebc Mon Sep 17 00:00:00 2001 From: TyroneSWG Date: Wed, 1 Jan 2020 23:33:36 -0500 Subject: [PATCH] ITV deeds may no longer be used more than once. --- .gitignore | 1 + .../instant_travel_terminal_deed.java | 34 +++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 0ea8568dc..2ec20ee2a 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ object_template_crc_string_table.tab **/.idea/* *.iml +sku.0/sys.server/compiled/game/script/tyrone/* \ No newline at end of file diff --git a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java b/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java index fad1ff20b..2a6b99408 100755 --- a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java +++ b/sku.0/sys.server/compiled/game/script/systems/veteran_reward/instant_travel_terminal_deed.java @@ -28,46 +28,60 @@ public class instant_travel_terminal_deed extends script.base_script if(getLevel(player) < minimumLevel){ 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); } - else if (hasObjVar(self, "privateerShip")) + else if (hasObjVar(self, "privateerShip") && (!hasObjVar(player, "itv.owned.privateer"))) { grantCommand(player, "callforprivateerpickup"); + setObjVar(player, "itv.owned.privateer", 1); destroyObject(self); } - else if (hasObjVar(self, "royalShip")) + else if (hasObjVar(self, "royalShip") && (!hasObjVar(player, "itv.owned.royalship"))) { grantCommand(player, "callforroyalpickup"); + setObjVar(player, "itv.owned.royalship", 1); destroyObject(self); } - else if (hasObjVar(self, "junk")) + else if (hasObjVar(self, "junk") && (!hasObjVar(player, "itv.owned.junk"))) { grantCommand(player, "callforrattletrappickup"); + setObjVar(player, "itv.owned.junk", 1); destroyObject(self); } - else if (hasObjVar(self, "tcg_itv_home")) + else if (hasObjVar(self, "tcg_itv_home") && (!hasObjVar(player, "itv.owned.solar"))) { grantCommand(player, "callforsolarsailerpickup"); + setObjVar(player, "itv.owned.solar", 1); destroyObject(self); } - else if (hasObjVar(self, "tcg_itv_location")) + else if (hasObjVar(self, "tcg_itv_location") && (!hasObjVar(player, "itv.owned.g9rigger"))) { grantCommand(player, "callforg9riggerpickup"); + setObjVar(player, "itv.owned.g9rigger", 1); destroyObject(self); } - else if (hasObjVar(self, "itv_snowspeeder")) + else if (hasObjVar(self, "itv_snowspeeder") && (!hasObjVar(player, "itv.owned.snowspeeder"))) { grantCommand(player, "callforsnowspeeder"); + setObjVar(player, "itv.owned.snowspeeder", 1); destroyObject(self); } - else if (hasObjVar(self, "itv_slave_1")) + else if (hasObjVar(self, "itv_slave_1") && (!hasObjVar(player, "itv.owned.slave1"))) { grantCommand(player, "callforslave1pickup"); + setObjVar(player, "itv.owned.slave1", 1); destroyObject(self); } + else if (hasObjVar(self, "default_itv") && (!hasObjVar(player, "itv.owned.callforpickup"))) + { + grantCommand(player, "callforpickup"); + setObjVar(player, "itv.owned.callforpickup", 1); + destroyObject(self); + + } else { - grantCommand(player, "callforpickup"); - destroyObject(self); - } + sendSystemMessageTestingOnly(player, "You have already used this item."); + return SCRIPT_CONTINUE; + } } return SCRIPT_CONTINUE; }