Use Eclipse it is the best tool you can use besides us
|
hi i want to make a dialogues for con but i get this error
and this is my dialoguesstarting...
src\com\rs\game\player\dialogues\EstateAgent.java: 32: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_3_LARGE_OPTIONS, "What would you li
to do?", "Purchase a house.", "Change the looks.", "Hire a servant.");
^
required: String[]
found: short,String,String,String,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 61: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_4_OPTIONS, "Where do you want your
se?", "Rimmington", "Tavelry", "Yanille", "Never mind.");
^
required: String[]
found: short,String,String,String,String,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 76: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_1_TEXT_INFO, "You n
a construction level of 50 or higher to buy this house!");
^
required: String[]
found: short,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 80: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_2_TEXT_INFO, "You d
t have " + HouseLocation.TAVELRY.getHouseCost() + " coins to buy this house."
You need " + remainder + " more coins to buy it.");
^
required: String[]
found: short,String,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 90: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_1_TEXT_INFO, "You n
a construction level of 99 to buy this house!");
^
required: String[]
found: short,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 94: error: method sendDialo
in class Dialogue cannot be applied to given types;
sendDialogue(SEND_2_TEXT_INFO, "You d
t have " + HouseLocation.YANILLE.getHouseCost() + " coins to buy this house."
You need " + remainder + " more coins to buy it.");
^
required: String[]
found: short,String,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 103: error: method sendDial
e in class Dialogue cannot be applied to given types;
sendDialogue(SEND_5_OPTIONS, "What style would you li
", "Basic wood", "Basic Stone", "White Washed Stone", "Fremennik Wood", "More
^
required: String[]
found: short,String,String,String,String,String,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 115: error: method sendDial
e in class Dialogue cannot be applied to given types;
sendDialogue(SEND_1_TEXT_INFO, "You n
to have a level of 10 or more to buy this.");
^
required: String[]
found: short,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 133: error: method sendDial
e in class Dialogue cannot be applied to given types;
sendDialogue(SEND_1_TEXT_INFO, "You need at l
t 2 bedrooms to hire a servant.");
^
required: String[]
found: short,String
reason: argument type short does not conform to vararg element type String
src\com\rs\game\player\dialogues\EstateAgent.java: 137: error: method sendDial
e in class Dialogue cannot be applied to given types;
sendDialogue(SEND_5_OPTIONS, "Which servant would you
ke to hire?", "Rick (level 20)", "Maid (level 25)",
^
required: String[]
found: short,String,String,String,String,String,String
reason: argument type short does not conform to vararg element type String
10 errors
any know to fix?package com.rs.game.player.dialogues;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.game.npc.NPC;
import com.rs.game.player.content.construction.HouseLocat ion;
import com.rs.game.player.content.construction.RoomRefere nce;
import com.rs.game.player.content.construction.ServantTyp e;
public class EstateAgent extends Dialogue {
int npcId;
int i;
@Override
public void start() {
npcId = (Integer) parameters[0];
i = player.getSkills().getLevel(22);
sendEntityDialogue(SEND_2_TEXT_CHAT,
new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
"Hello, I am Free-Run's estate agent. I can sell you a house ",
" and home upgrades, so how may I help you?" }, IS_NPC, npcId, 9827);
}
@Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'd like to talk about houses." },
IS_PLAYER, player.getIndex(), 9827);
stage = 1;
} else if (stage == 1) {
sendDialogue(SEND_3_LARGE_OPTIONS, "What would you like to do?", "Purchase a house.", "Change the looks.", "Hire a servant.");
stage = 2;
} else if (stage == 2) {
switch (componentId) {
case 2:
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'd like to buy a house please." },
IS_PLAYER, player.getIndex(), 9827);
stage = 3;
break;
case 3:
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'd like to change the looks of my house please." },
IS_PLAYER, player.getIndex(), 9827);
stage = 6;
break;
case 4:
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'd like to hire a servant." },
IS_PLAYER, player.getIndex(), 9827);
stage = 8;
break;
}
} else if (stage == 3) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
"Where would you like to buy a house from?"}, IS_NPC, npcId, 9827);
stage = 4;
} else if (stage == 4) {
sendDialogue(SEND_4_OPTIONS, "Where do you want your house?", "Rimmington", "Tavelry", "Yanille", "Never mind.");
stage = 5;
} else if (stage == 5) {
switch (componentId) {
case 1:
player.setHouseLocation(HouseLocation.RIMMINGTON);
player.getInventory().deleteItem(995, HouseLocation.RIMMINGTON.getHouseCost());
end();
break;
case 2:
if (i >= 50 && player.getInventory().containsItem(995, HouseLocation.TAVELRY.getHouseCost())) {
player.setHouseLocation(HouseLocation.TAVELRY);
player.getInventory().deleteItem(995, HouseLocation.TAVELRY.getHouseCost());
end();
} else if (i < 50){
sendDialogue(SEND_1_TEXT_INFO, "You need a construction level of 50 or higher to buy this house!");
stage = 4;
} else if (!player.getInventory().containsItem(995, HouseLocation.TAVELRY.getHouseCost())) {
int remainder = HouseLocation.TAVELRY.getHouseCost() - player.getInventory().getItems().getNumberOf(995);
sendDialogue(SEND_2_TEXT_INFO, "You don't have " + HouseLocation.TAVELRY.getHouseCost() + " coins to buy this house.", "You need " + remainder + " more coins to buy it.");
stage = 4;
}
break;
case 3:
if (i == 99 && player.getInventory().containsItem(995, HouseLocation.YANILLE.getHouseCost())) {
player.setHouseLocation(HouseLocation.YANILLE);
player.getInventory().deleteItem(995, HouseLocation.YANILLE.getHouseCost());
end();
} else if (i < 99) {
sendDialogue(SEND_1_TEXT_INFO, "You need a construction level of 99 to buy this house!");
stage = 4;
} else if (!player.getInventory().containsItem(995, HouseLocation.YANILLE.getHouseCost())) {
int remainder = HouseLocation.YANILLE.getHouseCost() - player.getInventory().getItems().getNumberOf(995);
sendDialogue(SEND_2_TEXT_INFO, "You don't have " + HouseLocation.YANILLE.getHouseCost() + " coins to buy this house.", "You need " + remainder + " more coins to buy it.");
stage = 4;
}
break;
case 4:
stage = -1;
break;
}
} else if (stage == 6) {
sendDialogue(SEND_5_OPTIONS, "What style would you like?", "Basic wood", "Basic Stone", "White Washed Stone", "Fremennik Wood", "More");
stage = 7;
} else if (stage == 7) {
switch (componentId) {
case 1:
player.setPlace(0);
break;
case 2:
if (i >= 10 && player.getInventory().containsItem(995, 5000)) {
player.setPlace(1);
end();
} else if (i < 10) {
sendDialogue(SEND_1_TEXT_INFO, "You need to have a level of 10 or more to buy this.");
stage = 6;
}
break;
}
} else if (stage == 8) {
int numberOfBedrooms = 0;
for (RoomReference room : player.getRooms()) { //Check if player has 2+ bedrooms
if (room.getRoom().getName().equalsIgnoreCase("bedroo m")) {
numberOfBedrooms++;
}
}
if (numberOfBedrooms > 1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
"Which servant would you like to hire?" }, IS_NPC, npcId, 9827);
stage = 9;
} else {
sendDialogue(SEND_1_TEXT_INFO, "You need at least 2 bedrooms to hire a servant.");
return;
}
} else if (stage == 9) {
sendDialogue(SEND_5_OPTIONS, "Which servant would you like to hire?", "Rick (level 20)", "Maid (level 25)",
"Cook (level 30)", "Butler (level 40)", "Demonic Butler (level 50)");
stage = 10;
} else if (stage == 10) {
int i = player.getSkills().getLevel(22);
switch (componentId) {
case 1:
if (i >= 20) {
player.setButler(ServantType.RICK);
player.getPackets().sendGameMessage("You purchased Rick, the servant!");
} else {
}
break;
case 2:
if (i >= 25) {
} else {
}
break;
case 3:
if (i >= 30) {
} else {
}
break;
case 4:
if (i >= 40) {
} else {
}
break;
case 5:
if (i >= 50) {
} else {
}
break;
}
}
}
@Override
public void finish() {
}
}
it's fixed. but when I click "Purchase a house." it do nothing
any know how i fix thanksCode:package com.rs.game.player.dialogues; import com.rs.cache.loaders.NPCDefinitions; import com.rs.game.npc.NPC; import com.rs.game.player.content.construction.HouseLocation; import com.rs.game.player.content.construction.RoomReference; import com.rs.game.player.content.construction.ServantType; public class EstateAgent extends Dialogue { int npcId; int i; @Override public void start() { npcId = (Integer) parameters[0]; i = player.getSkills().getLevel(22); sendEntityDialogue(SEND_2_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Hello, I am Free-Run's estate agent. I can sell you a house ", " and home upgrades, so how may I help you?" }, IS_NPC, npcId, 9827); } @Override public void run(int interfaceId, int componentId) { if (stage == -1) { sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "I'd like to talk about houses." }, IS_PLAYER, player.getIndex(), 9827); stage = 1; } else if (stage == 1) { sendOptionsDialogue(SEND_DEFAULT_OPTIONS_TITLE, "Purchase a house.", "Change the looks.", "Hire a servant."); stage = 2; switch (componentId) { case 2: sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "I'd like to buy a house please." }, IS_PLAYER, player.getIndex(), 9827); stage = 3; break; case 3: sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "I'd like to change the looks of my house please." }, IS_PLAYER, player.getIndex(), 9827); stage = 6; break; case 4: sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "I'd like to hire a servant." }, IS_PLAYER, player.getIndex(), 9827); stage = 8; break; } } else if (stage == 3) { sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Where would you like to buy a house from?"}, IS_NPC, npcId, 9827); stage = 4; } else if (stage == 4) { sendOptionsDialogue("Where do you want your house?", "Rimmington", "Tavelry", "Yanille", "Never mind."); stage = 5; } else if (stage == 5) { switch (componentId) { case 1: player.setHouseLocation(HouseLocation.RIMMINGTON); player.getInventory().deleteItem(995, HouseLocation.RIMMINGTON.getHouseCost()); end(); break; case 2: if (i >= 50 && player.getInventory().containsItem(995, HouseLocation.TAVELRY.getHouseCost())) { player.setHouseLocation(HouseLocation.TAVELRY); player.getInventory().deleteItem(995, HouseLocation.TAVELRY.getHouseCost()); end(); } else if (i < 50){ sendPlayerDialogue(SEND_1_TEXT_INFO, "You need a construction level of 50 or higher to buy this house!"); stage = 4; } else if (!player.getInventory().containsItem(995, HouseLocation.TAVELRY.getHouseCost())) { int remainder = HouseLocation.TAVELRY.getHouseCost() - player.getInventory().getItems().getNumberOf(995); sendPlayerDialogue(SEND_2_TEXT_INFO, "You don't have " + HouseLocation.TAVELRY.getHouseCost() + " coins to buy this house.", "You need " + remainder + " more coins to buy it."); stage = 4; } break; case 3: if (i == 99 && player.getInventory().containsItem(995, HouseLocation.YANILLE.getHouseCost())) { player.setHouseLocation(HouseLocation.YANILLE); player.getInventory().deleteItem(995, HouseLocation.YANILLE.getHouseCost()); end(); } else if (i < 99) { sendPlayerDialogue(SEND_1_TEXT_INFO, "You need a construction level of 99 to buy this house!"); stage = 4; } else if (!player.getInventory().containsItem(995, HouseLocation.YANILLE.getHouseCost())) { int remainder = HouseLocation.YANILLE.getHouseCost() - player.getInventory().getItems().getNumberOf(995); sendPlayerDialogue(SEND_2_TEXT_INFO, "You don't have " + HouseLocation.YANILLE.getHouseCost() + " coins to buy this house.", "You need " + remainder + " more coins to buy it."); stage = 4; } break; case 4: stage = -1; break; } } else if (stage == 6) { sendOptionsDialogue("What style would you like?", "Basic wood", "Basic Stone", "White Washed Stone", "Fremennik Wood", "More"); stage = 7; } else if (stage == 7) { switch (componentId) { case 1: player.setPlace(0); break; case 2: if (i >= 10 && player.getInventory().containsItem(995, 5000)) { player.setPlace(1); end(); } else if (i < 10) { sendPlayerDialogue(SEND_1_TEXT_INFO, "You need to have a level of 10 or more to buy this."); stage = 6; } break; } } else if (stage == 8) { int numberOfBedrooms = 0; for (RoomReference room : player.getRooms()) { //Check if player has 2+ bedrooms if (room.getRoom().getName().equalsIgnoreCase("bedroom")) { numberOfBedrooms++; } } if (numberOfBedrooms > 1) { sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Which servant would you like to hire?" }, IS_NPC, npcId, 9827); stage = 9; } else { sendPlayerDialogue(SEND_1_TEXT_INFO, "You need at least 2 bedrooms to hire a servant."); return; } } else if (stage == 9) { sendOptionsDialogue("Which servant would you like to hire?", "Rick (level 20)", "Maid (level 25)", "Cook (level 30)", "Butler (level 40)", "Demonic Butler (level 50)"); stage = 10; } else if (stage == 10) { int i = player.getSkills().getLevel(22); switch (componentId) { case 1: if (i >= 20) { player.setButler(ServantType.RICK); player.getPackets().sendGameMessage("You purchased Rick, the servant!"); } else { } break; case 2: if (i >= 25) { } else { } break; case 3: if (i >= 30) { } else { } break; case 4: if (i >= 40) { } else { } break; case 5: if (i >= 50) { } else { } break; } } } @Override public void finish() { } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |