Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Add Moongate script to get the server settings now.
  • Loading branch information
DragonSlayer62 committed Nov 17, 2023
1 parent 875a861 commit 2504cce
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
55 changes: 29 additions & 26 deletions data/js/item/moongate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// Criminals, aggressors in PvP combat can no longer use public moongates (Xuri)

// Set to 0 to disable teleport locations for a certain map from appearing in the moongate menu
const enabledMoongate = GetServerSetting("MoongateFacets");
var enableFelucca = 1;
var enableTrammel = 0;
var enableIlshenar = 0;
Expand Down Expand Up @@ -350,7 +351,7 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 47, 207, 0xfa5, 1, 0, 0 );
myGump.AddText( 80, 210, 0, GetDictionaryEntry( 2709, srcSock.language )); // CANCEL
//Facet Buttons
if( enableFelucca == 1 )
if( enabledMoongate >= 0 )
{
myGump.AddText( 70, 70, 12, "Felucca" );
myGump.AddButton( 48, 72, 0x4b9, 0, 1, 0 );
Expand All @@ -372,22 +373,22 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddText( 170, 210, 0, "Jhelom" );
myGump.AddButton( 150, 215, 0x837, 1, 0, 12 );
}
if( enableTrammel == 1 )
if ( enabledMoongate >= 3 )
{
myGump.AddText( 70, 90, 0, "Trammel" );
myGump.AddButton( 48, 95, 0x4b9, 0, 2, 0 );
}
if( enableIlshenar == 1 )
if (eenabledMoongate >= 4 )
{
myGump.AddText( 70, 110, 0, "Iishenar" );
myGump.AddButton( 48, 115, 0x4b9, 0, 3, 0 );
}
if( enableMalas == 1 )
if (enabledMoongate >= 8 )
{
myGump.AddText( 70, 130, 0, "Malas" );
myGump.AddButton( 48, 135, 0x4b9, 0, 4, 0 );
}
if( enableTokuno == 1 )
if (enabledMoongate >= 16 )
{
myGump.AddText( 70, 150, 0, "Tokuno Islands" );
myGump.AddButton( 48, 155, 0x4b9, 0, 5, 0 );
Expand All @@ -401,12 +402,12 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 47, 207, 0xfa5, 1, 0, 0 );
myGump.AddText( 80, 210, 0, GetDictionaryEntry( 2709, srcSock.language )); // CANCEL

if( enableFelucca == 1 )
if (enabledMoongate >= 0 )//Felucca
{
myGump.AddText( 70, 70, 0, "Felucca" );
myGump.AddButton( 48, 72, 0x4b9, 0, 1, 0 );
}
if( enableTrammel == 1 )
if (enabledMoongate >= 3 )//Trammel
{
myGump.AddText( 70, 90, 12, "Trammel" );
myGump.AddButton( 48, 95, 0x4b9, 0, 2, 0 );
Expand All @@ -427,17 +428,17 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddText( 170, 210, 0, "Jhelom" );
myGump.AddButton( 150, 215, 0x837, 1, 0, 20 );
}
if( enableIlshenar == 1 )
if (enabledMoongate >= 4 )
{
myGump.AddText( 70, 110, 0, "Iishenar" );
myGump.AddButton( 48, 115, 0x4b9, 0, 3, 0 );
}
if( enableMalas == 1 )
if (enabledMoongate >= 8 )
{
myGump.AddText( 70, 130, 0, "Malas" );
myGump.AddButton( 48, 135, 0x4b9, 0, 4, 0 );
}
if( enableTokuno == 1 )
if (enabledMoongate >= 16 )
{
myGump.AddText( 70, 150, 0, "Tokuno Islands" );
myGump.AddButton( 48, 155, 0x4b9, 0, 5, 0 );
Expand All @@ -451,17 +452,17 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 47, 207, 0xfa5, 1, 0, 0 );
myGump.AddText( 80, 210, 0, GetDictionaryEntry( 2709, srcSock.language )); // CANCEL

if( enableFelucca == 1 )
if (enabledMoongate >= 0 )
{
myGump.AddText( 70, 70, 0, "Felucca" );
myGump.AddButton( 48, 72, 0x4b9, 0, 1, 0 );
}
if( enableTrammel == 1 )
if (enabledMoongate >= 3 )
{
myGump.AddText( 70, 90, 0, "Trammel" );
myGump.AddButton( 48, 95, 0x4b9, 0, 2, 0 );
}
if( enableIlshenar == 1 )
if (enabledMoongate >= 4 )
{
myGump.AddText( 70, 110, 12, "Iishenar" );
myGump.AddButton( 48, 115, 0x4b9, 0, 3, 0 );
Expand All @@ -485,12 +486,12 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddText( 170, 230, 0, "Chaos" );
myGump.AddButton( 150, 235, 0x837, 1, 0, 29 );
}
if( enableMalas == 1 )
if (enabledMoongate >= 8 )
{
myGump.AddText( 70, 130, 0, "Malas" );
myGump.AddButton( 48, 135, 0x4b9, 0, 4, 0 );
}
if( enableTokuno == 1 )
if (enabledMoongate >= 16 )
{
myGump.AddText( 70, 150, 0, "Tokuno Islands" );
myGump.AddButton( 48, 155, 0x4b9, 0, 5, 0 );
Expand All @@ -504,22 +505,22 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 47, 207, 0xfa5, 1, 0, 0 );
myGump.AddText( 80, 210, 0, GetDictionaryEntry( 2709, srcSock.language )); // CANCEL

if( enableFelucca == 1 )
if (enabledMoongate >= 0 )
{
myGump.AddText( 70, 70, 0, "Felucca" );
myGump.AddButton( 48, 72, 0x4b9, 0, 1, 0 );
}
if( enableTrammel == 1 )
if (enabledMoongate >= 3 )
{
myGump.AddText( 70, 90, 0, "Trammel" );
myGump.AddButton( 48, 95, 0x4b9, 0, 2, 0 );
}
if( enableIlshenar == 1 )
if (enabledMoongate >= 4 )
{
myGump.AddText( 70, 110, 0, "Iishenar" );
myGump.AddButton( 48, 115, 0x4b9, 0, 3, 0 );
}
if( enableMalas == 1 )
if (enabledMoongate >= 8 )
{
myGump.AddText( 70, 130, 12, "Malas" );
myGump.AddButton( 48, 135, 0x4b9, 0, 4, 0 );
Expand All @@ -531,7 +532,7 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddText( 170, 110, 0, "Umbra" );
myGump.AddButton( 150, 115, 0x837, 1, 0, 32 );
}
if( enableTokuno == 1 )
if (enabledMoongate >= 16 )
{
myGump.AddText( 70, 150, 0, "Tokuno Islands" );
myGump.AddButton( 48, 155, 0x4b9, 0, 5, 0 );
Expand All @@ -545,27 +546,27 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 47, 207, 0xfa5, 1, 0, 0 );
myGump.AddText( 80, 210, 0, GetDictionaryEntry( 2709, srcSock.language )); // CANCEL

if( enableFelucca == 1 )
if (enabledMoongate >= 0 )
{
myGump.AddText( 70, 70, 0, "Felucca" );
myGump.AddButton( 48, 72, 0x4b9, 0, 1, 0 );
}
if( enableTrammel == 1 )
if (enabledMoongate >= 3 )
{
myGump.AddText( 70, 90, 0, "Trammel" );
myGump.AddButton( 48, 95, 0x4b9, 0, 2, 0 );
}
if( enableIlshenar == 1 )
if (enabledMoongate >= 4 )
{
myGump.AddText( 70, 110, 0, "Iishenar" );
myGump.AddButton( 48, 115, 0x4b9, 0, 3, 0 );
}
if( enableMalas == 1 )
if (enabledMoongate >= 8 )
{
myGump.AddText( 70, 130, 0, "Malas" );
myGump.AddButton( 48, 135, 0x4b9, 0, 4, 0 );
}
if( enableTokuno == 1 )
if (enabledMoongate >= 16 )
{
myGump.AddText( 70, 150, 12, "Tokuno Islands" );
myGump.AddButton( 48, 155, 0x4b9, 0, 5, 0 );
Expand All @@ -577,4 +578,6 @@ function DisplayTravelGump( srcSock, pUser )
myGump.AddButton( 150, 115, 0x837, 1, 0, 35 );
}
myGump.Send( srcSock );
}
}

function _restorecontext_() {}
4 changes: 2 additions & 2 deletions source/SEFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2933,7 +2933,7 @@ JSBool SE_SetSpawnRegionFacetStatus( [[maybe_unused]] JSContext *cx, [[maybe_unu
//o------------------------------------------------------------------------------------------------o
JSBool SE_GetMoongateFacetStatus( [[maybe_unused]] JSContext *cx, [[maybe_unused]] JSObject *obj, uintN argc, jsval *argv, jsval *rval )
{
if( argc > 1 )
if( argc != 1 )
{
ScriptError( cx, oldstrutil::format( "GetShowMoongateFacetStatus: Unknown Count of Arguments: %d", argc ).c_str() );
return JS_FALSE;
Expand Down Expand Up @@ -2961,7 +2961,7 @@ JSBool SE_GetMoongateFacetStatus( [[maybe_unused]] JSContext *cx, [[maybe_unused
//o------------------------------------------------------------------------------------------------o
JSBool SE_SetMoongateFacetStatus( [[maybe_unused]] JSContext *cx, [[maybe_unused]] JSObject *obj, uintN argc, jsval *argv, [[maybe_unused]] jsval *rval )
{
if( argc > 2 )
if( argc != 2 )
{
ScriptError( cx, oldstrutil::format( "SetMoongateFacetStatus: Unknown Count of Arguments: %d", argc ).c_str() );
return JS_FALSE;
Expand Down
2 changes: 1 addition & 1 deletion source/cServerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ auto CServerData::ResetDefaults() -> void
// Disable spawn regions for all facets by default
SetSpawnRegionsFacetStatus( 0 );

// Disable moongates for all facets by default
// Enable Felucca by defualt
SetMoongateFacetStatus( 0 );

// Set no assistant features as disabled by default
Expand Down

0 comments on commit 2504cce

Please sign in to comment.