Skip to content

Commit

Permalink
Fixes to vendor demo. Added event to turn vendors on and off
Browse files Browse the repository at this point in the history
  • Loading branch information
HeronAlexandria committed Dec 30, 2021
1 parent aa06fbf commit 3e99932
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,3 @@ i i h i f f f f f f f s p
1187929 1187917 object/cell/cell.iff 12 0 0 0 1 0 0 0 $|
-19844656 0 object/tangible/planet_map_location/city.iff 0 1570.98 5 1342.91 0.938444 0 0.345432 0 $|
-90069420 0 object/tangible/theme_park/invisible_object.iff 0 1475.19 5 1371.49 1 0 0 0 fishing.controller $|
-3000000 0 object/tangible/ground_spawning/area_spawner.iff 0 1470.032 5 1352.6621 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_x|strSpawnerType|4|area|strSpawns|4|vendor_tok_x|$|
-3000001 0 object/tangible/ground_spawning/area_spawner.iff 0 1466.4631 5 1347.499 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_x|strSpawnerType|4|area|strSpawns|4|vendor_tok_c|$|
-3000002 0 object/tangible/ground_spawning/area_spawner.iff 0 1463.6592 5 1344.4375 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_x|strSpawnerType|4|area|strSpawns|4|vendor_tok_m|$|
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
objid container server_template_crc cell_index px py pz qw qx qy qz scripts objvars
i i h i f f f f f f f s p
-3000000 0 object/tangible/ground_spawning/area_spawner.iff 0 1470.032 5 1352.6621 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_x|strSpawnerType|4|area|strSpawns|4|vendor_tok_x|$|
-3000001 0 object/tangible/ground_spawning/area_spawner.iff 0 1466.4631 5 1347.499 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_c|strSpawnerType|4|area|strSpawns|4|vendor_tok_c|$|
-3000002 0 object/tangible/ground_spawning/area_spawner.iff 0 1463.6592 5 1344.4375 1 0 0 0 systems.spawning.spawner_area fltMaxSpawnTime|2|2.000000|fltMinSpawnTime|2|1.000000|fltRadius|2|0.000000|intDefaultBehavior|0|1|intGoodLocationSpawner|0|0|intSpawnCount|0|1|intSpawnSystem|0|1|registerWithController|0|1|strName|4|vendor_tok_m|strSpawnerType|4|area|strSpawns|4|vendor_tok_m|$|
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public int OnInitialize(obj_id self) throws InterruptedException
messageTo(self, "lifedayServerStart", null, 610.0f, false);
messageTo(self, "lovedayServerStart", null, 615.0f, false);
messageTo(self, "empiredayServerStart", null, holiday.EMPIRE_DAY_EVENT_START_DELAY, false);
messageTo(self, "vendorDemoServerStart", null, 120.0f, false);
return SCRIPT_CONTINUE;
}
public int OnAttach(obj_id self) throws InterruptedException
Expand All @@ -25,6 +26,7 @@ public int OnAttach(obj_id self) throws InterruptedException
messageTo(self, "lifedayServerStart", null, 730.0f, false);
messageTo(self, "lovedayServerStart", null, 735.0f, false);
messageTo(self, "empiredayServerStart", null, (holiday.EMPIRE_DAY_EVENT_START_DELAY + 100), false);
messageTo(self, "vendorDemoServerStart", null, 120.0f, false);
return SCRIPT_CONTINUE;
}
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
Expand All @@ -42,6 +44,7 @@ public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[]
String lifedayRunning = getConfigSetting("GameServer", "lifeday");
String lovedayRunning = getConfigSetting("GameServer", "loveday");
String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony");
String vendorDemoRunning = getConfigSetting("GameServer", "vendor_demo_event");
if (halloweenRunning != null && (halloweenRunning.equals("true") || halloweenRunning.equals("1")))
{
names[idx] = "holiday_event";
Expand Down Expand Up @@ -82,12 +85,28 @@ public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[]
{
names[idx] = "holiday_event";
attribs[idx] = "Empire Day Event Running = True";
idx++;
}
else
{
names[idx] = "holiday_event";
attribs[idx] = "Empire Day Event Running = False";
idx++;
}

if (vendorDemoRunning != null && (vendorDemoRunning.equals("true") || vendorDemoRunning.equals("1")))
{
names[idx] = "holiday_event";
attribs[idx] = "Vendor Demo Event Running = True";
}
else
{
names[idx] = "holiday_event";
attribs[idx] = "Vendor Demo Event Running = False";
}



return SCRIPT_CONTINUE;
}
public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException
Expand All @@ -106,6 +125,8 @@ public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws Interru
String lovedayRunning = getConfigSetting("GameServer", "loveday");
int empireday = universeWideEvents.indexOf("empireday_ceremony");
String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony");
int vendorDemo = universeWideEvents.indexOf("vendor_demo_event");
String vendorDemoRunning = getConfigSetting("GameServer", "vendor_demo_event");

switch (text) {
case "halloweenStart":
Expand Down Expand Up @@ -156,6 +177,7 @@ public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws Interru
case "empiredayStopForReals":
stopHolidayEventForReals(speaker, "empireday_ceremony");
return SCRIPT_OVERRIDE;

}
return SCRIPT_CONTINUE;
}
Expand Down Expand Up @@ -336,4 +358,43 @@ else if (empiredayRunning.equals("true") || empiredayRunning.equals("1"))
}
return SCRIPT_CONTINUE;
}

public int vendorDemoServerStart(obj_id self, dictionary params) throws InterruptedException
{

CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart Vendor Demo event handler called.");
String vendorDemoString = getCurrentUniverseWideEvents();
int vendorDemo = vendorDemoString.indexOf("vendor_demo_event");
String vendorDemoRunning = getConfigSetting("GameServer", "vendor_demo_event");
CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart vendorDemoString: " + vendorDemoString + " vendorDemo: " + vendorDemo + " vendorDemoRunning: " + vendorDemoRunning);

if (vendorDemoRunning == null)
{
CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart event is either not running or not in the server configs.");
if (vendorDemo > -1)
{
stopUniverseWideEvent("vendor_demo_event");
}
}
else if (vendorDemoRunning.equals("true") || vendorDemoRunning.equals("1"))
{
CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart event is starting.");

if (vendorDemo < 0)
{
if (!startUniverseWideEvent("vendor_demo_event"))
{
CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart startUniverseWideEvent reports FAILURE to start universe wide event.");
}
else
{
CustomerServiceLog("holidayEvent", "holiday_controller.vendorDemoServerStart startUniverseWideEvent reports SUCCESS starting universe wide event.");
}
}
}

return SCRIPT_CONTINUE;
}


}
Loading

0 comments on commit 3e99932

Please sign in to comment.