mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
* Code compiles - execution NOT tested * updating gitignore * Removed intellij settings files * Removed more intellij files * Added exclusion for JDK classes. * Fixed purchasing script for vendors that have listed coin types. * Updated script to not kick off until the entire preload is complete. * adds static name entry for Solo movie poster and tcg9 vendor entry * clean up empty and orphaned object templates * adds placeholder black market (static) spawns * corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors * Updated gitignore and removed intellij project files * Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src * Fixed appearance and template for terminal (#2) * Fixed appearance and template for terminal (#3) * Fixed appearance and template for terminal (#4) * Deleted another faulty/orphaned object template * Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges. * Fixed some unneeded java 11 changes
1004 lines
42 KiB
Java
Executable File
1004 lines
42 KiB
Java
Executable File
package script.conversation;
|
|
|
|
import script.library.*;
|
|
import script.*;
|
|
|
|
public class respecseller extends script.base_script
|
|
{
|
|
public respecseller()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/respecseller";
|
|
public boolean respecseller_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean respecseller_condition_hasBoughtRespecsBefore(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return hasObjVar(player, "respecsBought");
|
|
}
|
|
public boolean respecseller_condition_hasInventorySpace(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
obj_id inv = getObjectInSlot(player, "inventory");
|
|
int free = getVolumeFree(inv);
|
|
if (free < 20)
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
public boolean respecseller_condition_repeatCustomerHasInventorySpace(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
if (!hasObjVar(player, "respecsBought"))
|
|
{
|
|
return false;
|
|
}
|
|
obj_id inv = getObjectInSlot(player, "inventory");
|
|
int free = getVolumeFree(inv);
|
|
if (free < 20)
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
public boolean respecseller_condition_firstTimeCustomerHasInventorySpace(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
if (hasObjVar(player, "respecsBought"))
|
|
{
|
|
return false;
|
|
}
|
|
obj_id inv = getObjectInSlot(player, "inventory");
|
|
int free = getVolumeFree(inv);
|
|
if (free < 20)
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
public boolean respecseller_condition_hasCashToCoverRespec(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int cost = respec.getRespecCost(player);
|
|
int balance = getTotalMoney(player);
|
|
return cost <= balance;
|
|
}
|
|
public boolean respecseller_condition_hasCashToCoverReallocation(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int cost = respec.getReallocationCost(player);
|
|
int balance = getTotalMoney(player);
|
|
return cost <= balance;
|
|
}
|
|
public boolean respecseller_condition_hasExpertiseSkill(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
String[] skillList = getSkillListingForPlayer(player);
|
|
if (skillList != null)
|
|
{
|
|
for (String s : skillList) {
|
|
if (s.startsWith("expertise_")) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
public boolean respecseller_condition_hasExpertiseAllocated(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return hasSkill(player, "internal_expertise_autoallocated");
|
|
}
|
|
public boolean respecseller_condition_hasFreeReallocations(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return respec.hasFreeReallocation(player);
|
|
}
|
|
public boolean respecseller_condition_hasTwoOrMoreFreeRealloc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
|
|
{
|
|
if (respec.numFreeAllocations(player) == 1)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
public boolean respecseller_condition_hasNoMoreFreeRealloc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
|
|
{
|
|
if (respec.numFreeAllocations(player) == 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
public boolean respecseller_condition_hasCloningSickness(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return buff.hasBuff(player, "cloning_sickness");
|
|
}
|
|
public void respecseller_action_buyRespecToken(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
respec.startNpcRespec(player, npc);
|
|
}
|
|
public void respecseller_action_removeAutoExpertise(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
utils.fullExpertiseReset(player, true);
|
|
revokeSkill(player, "internal_expertise_autoallocated");
|
|
if (!hasSkill(player, "expertise"))
|
|
{
|
|
grantSkill(player, "expertise");
|
|
}
|
|
}
|
|
public void respecseller_action_buyReallocation(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
respec.handleNpcRealloc(player);
|
|
}
|
|
public String respecseller_tokenTO_tokenTO0001(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return new String();
|
|
}
|
|
public int respecseller_tokenDI_respecCost(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return respec.getRespecCost(player);
|
|
}
|
|
public int respecseller_tokenDI_reallocCost(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return respec.getReallocationCost(player);
|
|
}
|
|
public int respecseller_tokenDI_numFreeAlloc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return respec.numFreeAllocations(player);
|
|
}
|
|
public int respecseller_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_32"))
|
|
{
|
|
if (respecseller_condition_hasCloningSickness(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_90");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_firstTimeCustomerHasInventorySpace(player, npc))
|
|
{
|
|
doAnimationAction(npc, "explain");
|
|
string_id message = new string_id(c_stringFile, "s_58");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_60");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_64");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 21);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_repeatCustomerHasInventorySpace(player, npc))
|
|
{
|
|
doAnimationAction(npc, "apologize");
|
|
string_id message = new string_id(c_stringFile, "s_68");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_75");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_79");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 24);
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_respecCost(player, npc);
|
|
npcSpeak(player, pp);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_respecCost(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!respecseller_condition_hasInventorySpace(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_92");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_33"))
|
|
{
|
|
if (respecseller_condition_hasCloningSickness(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_89");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_hasExpertiseAllocated(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_35");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_37");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_45");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 3);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_hasTwoOrMoreFreeRealloc(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_47");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_51");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 6);
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_numFreeAlloc(player, npc);
|
|
npcSpeak(player, pp);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_numFreeAlloc(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_hasNoMoreFreeRealloc(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_80");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_81");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_82");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 9);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_hasFreeReallocations(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_70");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_71");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_72");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 12);
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_numFreeAlloc(player, npc);
|
|
npcSpeak(player, pp);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_numFreeAlloc(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_49");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_53");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_54");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 15);
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_reallocCost(player, npc);
|
|
npcSpeak(player, pp);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_reallocCost(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_37"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
respecseller_action_removeAutoExpertise(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_38");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_45"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_46");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_47"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
respecseller_action_buyReallocation(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_50");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_51"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_81"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
respecseller_action_buyReallocation(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_83");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_82"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_84");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_71"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
respecseller_action_buyReallocation(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_73");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_72"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_74");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_53"))
|
|
{
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "manipulate_high");
|
|
string_id message = new string_id(c_stringFile, "s_55");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_54"))
|
|
{
|
|
if (respecseller_condition_hasCashToCoverReallocation(player, npc))
|
|
{
|
|
respecseller_action_buyReallocation(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_56");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!respecseller_condition_hasCashToCoverReallocation(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_57");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_reallocCost(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_43"))
|
|
{
|
|
if (respecseller_condition_hasCloningSickness(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_90");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_firstTimeCustomerHasInventorySpace(player, npc))
|
|
{
|
|
doAnimationAction(npc, "explain");
|
|
string_id message = new string_id(c_stringFile, "s_58");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_60");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_64");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 21);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition_repeatCustomerHasInventorySpace(player, npc))
|
|
{
|
|
doAnimationAction(npc, "apologize");
|
|
string_id message = new string_id(c_stringFile, "s_68");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_75");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_79");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 24);
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_respecCost(player, npc);
|
|
npcSpeak(player, pp);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_respecCost(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!respecseller_condition_hasInventorySpace(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_92");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_60"))
|
|
{
|
|
doAnimationAction(player, "nod");
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "bow");
|
|
respecseller_action_buyRespecToken(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_62");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_64"))
|
|
{
|
|
doAnimationAction(player, "shake_head_no");
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "wave1");
|
|
string_id message = new string_id(c_stringFile, "s_66");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int respecseller_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_75"))
|
|
{
|
|
doAnimationAction(player, "pound_fist_palm");
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "manipulate_high");
|
|
string_id message = new string_id(c_stringFile, "s_77");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_79"))
|
|
{
|
|
doAnimationAction(player, "scream");
|
|
if (respecseller_condition_hasCashToCoverRespec(player, npc))
|
|
{
|
|
respecseller_action_buyRespecToken(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_86");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!respecseller_condition_hasCashToCoverRespec(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_88");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
prose_package pp = new prose_package();
|
|
pp.stringId = message;
|
|
pp.actor.set(player);
|
|
pp.target.set(npc);
|
|
pp.digitInteger = respecseller_tokenDI_respecCost(player, npc);
|
|
npcEndConversationWithMessage(player, pp);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if ((!isTangible(self)) || (isPlayer(self)))
|
|
{
|
|
detachScript(self, "conversation.respecseller");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException
|
|
{
|
|
int menu = menuInfo.addRootMenu(menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById(menu);
|
|
menuInfoData.setServerNotify(false);
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
|
{
|
|
clearCondition(self, CONDITION_CONVERSABLE);
|
|
detachScript(self, "conversation.respecseller");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException
|
|
{
|
|
Object[] objects = new Object[responses.length];
|
|
System.arraycopy(responses, 0, objects, 0, responses.length);
|
|
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
|
|
}
|
|
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException
|
|
{
|
|
obj_id npc = self;
|
|
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (respecseller_condition_hasExpertiseSkill(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_31");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_32");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_33");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 1);
|
|
npcStartConversation(player, npc, "respecseller", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "wave2");
|
|
string_id message = new string_id(c_stringFile, "s_41");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (respecseller_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_43");
|
|
}
|
|
utils.setScriptVar(player, "conversation.respecseller.branchId", 19);
|
|
npcStartConversation(player, npc, "respecseller", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException
|
|
{
|
|
if (!conversationId.equals("respecseller"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id npc = self;
|
|
int branchId = utils.getIntScriptVar(player, "conversation.respecseller.branchId");
|
|
if (branchId == 1 && respecseller_handleBranch1(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 3 && respecseller_handleBranch3(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 6 && respecseller_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 9 && respecseller_handleBranch9(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 12 && respecseller_handleBranch12(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 15 && respecseller_handleBranch15(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 19 && respecseller_handleBranch19(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 21 && respecseller_handleBranch21(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 24 && respecseller_handleBranch24(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
utils.removeScriptVar(player, "conversation.respecseller.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|