mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-15 23:04:31 -05:00
Fix WoD First Sister Alter Interaction
This commit is contained in:
@@ -14,37 +14,34 @@ import script.library.conversation;
|
||||
import script.library.groundquests;
|
||||
import script.library.utils;
|
||||
|
||||
public class wod_first_sister extends script.base_script
|
||||
{
|
||||
public wod_first_sister()
|
||||
{
|
||||
public class wod_first_sister extends script.base_script {
|
||||
public wod_first_sister() {
|
||||
}
|
||||
|
||||
public static String c_stringFile = "conversation/wod_first_sister";
|
||||
public boolean wod_first_sister_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
|
||||
public boolean wod_first_sister_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException {
|
||||
return true;
|
||||
}
|
||||
public boolean wod_first_sister_condition_talkTaskActive(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
|
||||
public boolean wod_first_sister_condition_talkTaskActive(obj_id player, obj_id npc) throws InterruptedException {
|
||||
return groundquests.isTaskActive(player, "wod_sister1", "killSister1");
|
||||
}
|
||||
public void wod_first_sister_action_sendSignalTPSister1(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
|
||||
public void wod_first_sister_action_sendSignalTPSister1(obj_id player, obj_id npc) throws InterruptedException {
|
||||
groundquests.sendSignal(player, "wod_first_sister_aggro");
|
||||
}
|
||||
public void wod_first_sister_action_aggroSister(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
|
||||
public void wod_first_sister_action_aggroSister(obj_id player, obj_id npc) throws InterruptedException {
|
||||
setInvulnerable(npc, false);
|
||||
startCombat(npc, player);
|
||||
clearCondition(npc, CONDITION_CONVERSABLE);
|
||||
}
|
||||
public int wod_first_sister_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
||||
{
|
||||
if (response.equals("s_8"))
|
||||
{
|
||||
|
||||
public int wod_first_sister_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException {
|
||||
if (response.equals("s_8")) {
|
||||
wod_first_sister_action_sendSignalTPSister1(player, npc);
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc))
|
||||
{
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc)) {
|
||||
wod_first_sister_action_aggroSister(player, npc);
|
||||
string_id message = new string_id(c_stringFile, "s_10");
|
||||
utils.removeScriptVar(player, "conversation.wod_first_sister.branchId");
|
||||
@@ -54,78 +51,69 @@ public class wod_first_sister extends script.base_script
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
if ((!isTangible(self)) || (isPlayer(self)))
|
||||
{
|
||||
|
||||
public int OnInitialize(obj_id self) throws InterruptedException {
|
||||
if ((!isTangible(self)) || (isPlayer(self))) {
|
||||
detachScript(self, "conversation.wod_first_sister");
|
||||
}
|
||||
setCondition(self, CONDITION_CONVERSABLE);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException {
|
||||
clearCondition(self, CONDITION_CONVERSABLE);
|
||||
detachScript(self, "conversation.wod_first_sister");
|
||||
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
|
||||
{
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException {
|
||||
obj_id npc = self;
|
||||
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player))
|
||||
{
|
||||
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player)) {
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
if (wod_first_sister_condition_talkTaskActive(player, npc))
|
||||
{
|
||||
if (wod_first_sister_condition_talkTaskActive(player, npc)) {
|
||||
string_id message = new string_id(c_stringFile, "s_6");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc))
|
||||
{
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc)) {
|
||||
++numberOfResponses;
|
||||
hasResponse = true;
|
||||
hasResponse0 = true;
|
||||
}
|
||||
if (hasResponse)
|
||||
{
|
||||
if (hasResponse) {
|
||||
int responseIndex = 0;
|
||||
string_id responses[] = new string_id[numberOfResponses];
|
||||
if (hasResponse0)
|
||||
{
|
||||
if (hasResponse0) {
|
||||
responses[responseIndex++] = new string_id(c_stringFile, "s_8");
|
||||
}
|
||||
utils.setScriptVar(player, "conversation.wod_first_sister.branchId", 1);
|
||||
npcStartConversation(player, npc, "wod_first_sister", message, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
chat.chat(npc, player, message);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc))
|
||||
{
|
||||
if (wod_first_sister_condition__defaultCondition(player, npc)) {
|
||||
string_id message = new string_id(c_stringFile, "s_9");
|
||||
chat.chat(npc, player, message);
|
||||
return SCRIPT_CONTINUE;
|
||||
@@ -133,20 +121,28 @@ public class wod_first_sister extends script.base_script
|
||||
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("wod_first_sister"))
|
||||
{
|
||||
|
||||
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException {
|
||||
if (!conversationId.equals("wod_first_sister")) {
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id npc = self;
|
||||
int branchId = utils.getIntScriptVar(player, "conversation.wod_first_sister.branchId");
|
||||
if (branchId == 1 && wod_first_sister_handleBranch1(player, npc, response) == SCRIPT_CONTINUE)
|
||||
{
|
||||
if (branchId == 1 && wod_first_sister_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) {
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
||||
utils.removeScriptVar(player, "conversation.wod_first_sister.branchId");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException
|
||||
{
|
||||
final obj_id altar = utils.getObjIdScriptVar(self, "wod_altar");
|
||||
if(isIdValid(altar) && exists(altar))
|
||||
{
|
||||
messageTo(altar, "firstSisterDeath", null, 0f, false);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,14 +11,37 @@ import script.base_script;
|
||||
import script.library.groundquests;
|
||||
import script.library.create;
|
||||
import script.library.ai_lib;
|
||||
import script.library.utils;
|
||||
|
||||
public class first_sister_altar extends script.base_script
|
||||
{
|
||||
public first_sister_altar()
|
||||
{
|
||||
}
|
||||
public static string_id SID_MNU_USE = new string_id("pet/pet_menu", "menu_store");
|
||||
public static final string_id TOO_SOON_REUSE = new string_id("spam", "snowball_not_ready");
|
||||
|
||||
/**
|
||||
* "Place the Offering"
|
||||
*/
|
||||
public static final string_id STF_PLACE_OFFERING = new string_id("quest/ground/wod_sister1", "task02_journal_entry_title");
|
||||
/**
|
||||
* "This object does not interest you."
|
||||
*/
|
||||
public static final string_id STF_NO_INTEREST = new string_id("quest/groundquests", "retrieve_item_no_interest");
|
||||
/**
|
||||
* "%TU is not %TT. Please try again later."
|
||||
*/
|
||||
public static final string_id STF_NOT_NOW = new string_id("spam", "not_available_fill_2");
|
||||
/**
|
||||
* "Naija Kymeri (Voidsister Huntress)"
|
||||
*/
|
||||
public static final string_id STF_MOB = new string_id("mob/creature_names", "wod_first_sister");
|
||||
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
messageTo(self, "handleFirstSisterSpawn", null, 30f, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
||||
{
|
||||
if (!isValidId(self) || !exists(self))
|
||||
@@ -29,11 +52,10 @@ public class first_sister_altar extends script.base_script
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (hasObjVar(self, "string_to_use") && hasObjVar(self, "string_to_use_1"))
|
||||
if(groundquests.isTaskActive(player, "wod_sister1", "useAltar"))
|
||||
{
|
||||
SID_MNU_USE = new string_id(getStringObjVar(self, "string_to_use"), getStringObjVar(self, "string_to_use_1"));
|
||||
mi.addRootMenu(menu_info_types.ITEM_USE, STF_PLACE_OFFERING);
|
||||
}
|
||||
mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_USE);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
||||
@@ -50,47 +72,47 @@ public class first_sister_altar extends script.base_script
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (hasObjVar(self, "quest_to_have") && hasObjVar(self, "signal_to_send") && hasObjVar(self, "task_to_have") && hasObjVar(self, "locX") && hasObjVar(self, "locY") && hasObjVar(self, "locZ") && hasObjVar(self, "toSpawn"))
|
||||
if(!groundquests.isTaskActive(player, "wod_sister1", "useAltar"))
|
||||
{
|
||||
if (groundquests.isTaskActive(player, getStringObjVar(self, "quest_to_have"), getStringObjVar(self, "task_to_have")) || !groundquests.hasCompletedTask(player, getStringObjVar(self, "quest_to_have"), "killSister1"))
|
||||
sendSystemMessage(player, STF_NO_INTEREST);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
final obj_id boss = utils.getObjIdScriptVar(self, "wod_mob");
|
||||
if(!isIdValid(boss) || !exists(boss) || isDead(boss) || isIncapacitated(boss))
|
||||
{
|
||||
prose_package pp = new prose_package();
|
||||
pp.stringId = STF_NOT_NOW;
|
||||
pp.actor.set(STF_MOB);
|
||||
pp.target.set("nearby right now");
|
||||
sendSystemMessageProse(player, pp);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getDistance(player, boss) > 20f)
|
||||
{
|
||||
if (hasObjVar(player, "wod.altarTimeout"))
|
||||
{
|
||||
sendSystemMessage(player, TOO_SOON_REUSE);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id[] targets = getNPCsInRange(getLocation(self), 100);
|
||||
if (targets != null && targets.length > 0)
|
||||
{
|
||||
for (int i = 0; i < targets.length; i++)
|
||||
{
|
||||
if (hasObjVar(targets[i], "rescuer") && getObjIdObjVar(targets[i], "rescuer") == player)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
location loc = new location(getIntObjVar(self, "locX"), getIntObjVar(self, "locY"), getIntObjVar(self, "locZ"));
|
||||
obj_id mob = create.object(getStringObjVar(self, "toSpawn"), loc, 92);
|
||||
if (!isValidId(mob) || !exists(mob))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setObjVar(mob, "rescuer", player);
|
||||
ai_lib.aiFollow(mob, player);
|
||||
groundquests.sendSignal(player, getStringObjVar(self, "signal_to_send"));
|
||||
setObjVar(player, "wod.altarTimeout", 1);
|
||||
messageTo(player, "resetWoDAltarTimeOut", null, 3.0f, false);
|
||||
pathTo(boss, utils.getRandomLocationInRing(getLocation(player), 3, 10));
|
||||
}
|
||||
groundquests.completeTask(player, "wod_sister1", "useAltar");
|
||||
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int resetWoDAltarTimeOut(obj_id self, obj_id player, dictionary params) throws InterruptedException
|
||||
|
||||
public int firstSisterDeath(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if (hasObjVar(player, "wod.altarTimeout"))
|
||||
{
|
||||
removeObjVar(player, "wod.altarTimeout");
|
||||
}
|
||||
utils.removeScriptVar(self, "wod_mob");
|
||||
messageTo(self, "handleFirstSisterSpawn", null, 600f, false);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
public int handleFirstSisterSpawn(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
final obj_id boss = create.createCreature("wod_first_sister_aggro",
|
||||
new location(-4836f, 135f, -2939f, "dathomir", obj_id.NULL_ID), true);
|
||||
utils.setScriptVar(self, "wod_mob", boss);
|
||||
utils.setScriptVar(boss, "wod_altar", self);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ s s s b s s b s s s b s s s i e(none=0,complete=1,clear=2)[none] e(none=0,comple
|
||||
quest.task.ground.go_to_location @quest/ground/wod_sister1:task00_journal_entry_title @quest/ground/wod_sister1:task00_journal_entry_description 1 0 1 findHut 0 0 none none 1 1 1 dathomir -5039 8 -2768 @quest/ground/wod_sister1:task00_waypoint_name 0 0.0 0.0 0.0 10.0 0
|
||||
quest.task.ground.destroy_multi_and_loot @quest/ground/wod_sister1:task01_journal_entry_title @quest/ground/wod_sister1:task01_journal_entry_description 1 0 2 huntMalkloc 0 0 none none 1 1 1 dathomir -5039 8 -2768 @quest/ground/wod_sister1:task01_waypoint_name 0 0.0 0.0 0.0 0 malkloc Fresh Meat 5 75 0 0 0
|
||||
quest.task.ground.wait_for_signal @quest/ground/wod_sister1:task02_journal_entry_title @quest/ground/wod_sister1:task02_journal_entry_description 1 0 3 useAltar 0 0 none none 1 1 1 dathomir -4841 135 -2938 @quest/ground/wod_sister1:task02_waypoint_name 0 0.0 0.0 0.0 0 usedAltar 1 0 0 0 0 0
|
||||
quest.task.ground.destroy_multi @quest/ground/wod_sister1:task03_journal_entry_title @quest/ground/wod_sister1:task03_journal_entry_description 1 0 4 killSister1 0 0 none none 1 1 1 dathomir -4782 128 -2951 @quest/ground/wod_sister1:task03_waypoint_name 0 0.0 0.0 0.0 0 wod_first_sister_aggro 0 1
|
||||
quest.task.ground.destroy_multi @quest/ground/wod_sister1:task03_journal_entry_title @quest/ground/wod_sister1:task03_journal_entry_description 1 0 4 killSister1 0 0 none none 1 1 0 dathomir -4782 128 -2951 @quest/ground/wod_sister1:task03_waypoint_name 0 0.0 0.0 0.0 0 wod_first_sister_aggro 0 1
|
||||
quest.task.ground.comm_player 0 0 5 ghostComm 0 0 none none 1 1 0 dathomir -6895.10009765625 461.869995117188 -4853.72998046875 @quest/ground/wod_sister1:task04_waypoint_name 0 0.0 0.0 0.0 @quest/ground/wod_sister1:task04_comm_message_text object/mobile/dressed_wod_ghost_guide_comm.iff
|
||||
quest.task.ground.wait_for_signal @quest/ground/wod_sister1:task05_journal_entry_title @quest/ground/wod_sister1:task05_journal_entry_description 1 0 6 returnGhost 0 0 none none 1 1 1 dathomir -6895.10009765625 461.869995117188 -4853.72998046875 @quest/ground/wod_sister1:task05_waypoint_name 0 0.0 0.0 0.0 0 hasReturned 1 0 0 0 0 0
|
||||
quest.task.ground.complete_quest 0 0 0 0 none none 1 1 0 tatooine 0.0 0.0 0.0 0 0.0 0.0 0.0
|
||||
|
||||
Reference in New Issue
Block a user