mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-15 23:04:31 -05:00
willy wonka is dead
This commit is contained in:
@@ -211,7 +211,7 @@ public class ai extends script.base_script
|
||||
pathTo(npc, pathWaypoint);
|
||||
return;
|
||||
}
|
||||
if (getConfigSetting("GameServer", "disableAILoitering") != null)
|
||||
if (utils.checkConfigFlag("GameServer", "disableAILoitering"))
|
||||
{
|
||||
LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc(" + npc + ") disableAILoitering");
|
||||
return;
|
||||
@@ -1005,12 +1005,6 @@ public class ai extends script.base_script
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
boolean hasLoot = loot.addLoot(self);
|
||||
String goldenTicketActive = getConfigSetting("EventTeam", "goldenTicket");
|
||||
if(goldenTicketActive != null && goldenTicketActive.equals("true")) {
|
||||
for (obj_id killer : killers) {
|
||||
loot.addGoldenTicket(killer, self);
|
||||
}
|
||||
}
|
||||
boolean hasChanceToDropChroniclesLoot = false;
|
||||
if (hasObjVar(self, xp.VAR_TOP_GROUP))
|
||||
{
|
||||
|
||||
@@ -160,47 +160,6 @@ public class loot extends script.base_script
|
||||
}
|
||||
return hasLoot;
|
||||
}
|
||||
public static boolean addGoldenTicket(obj_id player, obj_id corpse) throws InterruptedException{
|
||||
if(!hasObjVar(player, "lottery.looted") && getIntObjVar(player, "lottery.availableTickets") > 0) {
|
||||
obj_id broker = getObjIdObjVar(player, "lottery.broker");
|
||||
if(!isValidId(broker)) return false;
|
||||
Vector qualifiers = getResizeableObjIdArrayObjVar(broker, "lottery.qualifiers");
|
||||
obj_id playerStationId = utils.stringToObjId("" + getPlayerStationId(player));
|
||||
if(qualifiers != null && utils.getElementPositionInArray(qualifiers, playerStationId) > -1) return false;
|
||||
double dropChance = 2;
|
||||
try {
|
||||
dropChance = Double.parseDouble(getConfigSetting("EventTeam", "goldenTicketDropChance"));
|
||||
}
|
||||
catch(Exception e){}
|
||||
double rng = Math.random() * 100;
|
||||
if(dropChance > 0 && rng <= dropChance) {
|
||||
String goldenTicket = "object/tangible/travel/travel_ticket/dungeon_ticket.iff";
|
||||
obj_id[] items = utils.getAllItemsInBankAndInventory(player);
|
||||
if(items != null) {
|
||||
for (obj_id item : items) {
|
||||
if (getTemplateName(item).equals(goldenTicket)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
obj_id lootItem = createObject(goldenTicket, utils.getInventoryContainer(player), "");
|
||||
setName(lootItem, "A Golden Ticket");
|
||||
setObjVar(lootItem, "noTrade", 1);
|
||||
if(isValidId(lootItem)){
|
||||
setObjVar(player, "lottery.looted", 1);
|
||||
if(ai_lib.isHumanoid(corpse)){
|
||||
chat.chat(corpse, "...you... you've won, Charlie...");
|
||||
}
|
||||
play2dNonLoopingSound(player, "sound/utinni.snd");
|
||||
sendSystemMessage(player, "A particularly shiny Golden Ticket has been placed in your inventory!", null);
|
||||
LOG("live-lottery","Player " + getFirstName(player) + " (" + player + ") has looted a lottery ticket.");
|
||||
obj_id inv = utils.getInventoryContainer(corpse);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static int getCashForLevel(String mobType, int level) throws InterruptedException
|
||||
{
|
||||
if (mobType == null || mobType.equals("") || level < 1)
|
||||
|
||||
Reference in New Issue
Block a user