Merge pull request #386 from RezecNoble/master

NoTrade Removable Fix
This commit is contained in:
Cekis
2024-09-03 15:07:23 -07:00
committed by GitHub
3 changed files with 11 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ public class no_trade_removable extends script.base_script {
public static final string_id SID_ITEM_MADE_TRADABLE = new string_id("system_msg", "item_made_tradable");
public static final String SCRIPT_NAME = "item.special.no_trade_removable";
public static final String NO_TRADE_SCRIPT_NAME = "item.special.nomove";
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException {
if ((getOwner(self) == player || isGod(player)) && hasObjVar(self, "noTrade")
@@ -48,6 +49,9 @@ public class no_trade_removable extends script.base_script {
if (hasObjVar(self, "noTrade")) {
removeObjVar(self, "noTrade");
if (hasScript(self, NO_TRADE_SCRIPT_NAME)) {
detachScript(self, NO_TRADE_SCRIPT_NAME);
}
sendSystemMessage(player, SID_ITEM_MADE_TRADABLE);
CustomerServiceLog("noTrade", getPlayerName(player) + " (" + player + ") removed the noTrade ObjVar from object " + getTemplateName(self) + " (" + self + ")");
detachScript(self, SCRIPT_NAME);

View File

@@ -152,6 +152,12 @@ public class static_item extends script.base_script
}
}
attachScript(object, "item.static_item_base");
// attaching the no_trade_removable script.
// Doing this here instead of the above because this runs on Init for all existing static_items instead of only at creation time
String[] no_trade_removable_items = dataTableGetStringColumn(ITEM_NO_TRADE_REMOVABLE_TABLE, 0);
if(no_trade_removable_items != null && Arrays.asList(no_trade_removable_items).contains(itemName)) {
attachScript(object, "item.special.no_trade_removable");
}
if (!jedi.isCrystalTuned(object))
{
setName(object, "");

View File

@@ -13,7 +13,7 @@ attributes = [
[name = "crafting" "complexity", experiment = "" "", value = 31..31],
[name = "crafting" "xp", experiment = "" "", value = 20000..20000],
[name = "crafting" "hp", experiment = "crafting" "exp_hp", value = 1350..2350],
[name = "crafting" "massMax", experiment = "crafting" "exp_massMax", value = 55375..58625]]
[name = "crafting" "massMax", experiment = "crafting" "exp_massMax", value = 160000..184000]]
slots = [
[name = "craft_item_ingredients_n" "frame", hardpoint = ""],