mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 03:16:42 +00:00
Dungeon Crawl custom code merge
Added numerous modding hooks. Added rules: Character:KeepLevelOverMax - Don't delevel a character if they are found to be over max level rule. Spells:UseCHAScribeHack - Optionally omit spells with CHA in effect12 when using scribespells and traindiscs Combat:MonkACBonusWeight - Adjust the weight threshold for monk AC bonus Combat:ClientStunLevel - Adjust the level clients kicks and bashes start to roll for stuns Combat;QuiverWRHasteDiv - Adjust the divisor applied to weight reduction for haste calcs Combat:UseArcheryBonusRoll - Make archery stationary bonus a roll Combat:ArcheryBonusChance - Archery stationary bonus chance Added account flags and associated perl wrappers Added EVENT_ITEM_TICK for interactive items Added EVENT_DUEL_WIN and EVENT_DUEL_LOSE, which exports $enemyname and $enemyid Added timer and interval to console worldshutdown command Added EQW interface for worldshutdown and server-wide messages
This commit is contained in:
@@ -5651,6 +5651,91 @@ XS(XS_Client_GetInstanceID)
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_HasSpellScribed); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_HasSpellScribed)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::HasSpellScribed(THIS, spell_id)");
|
||||
{
|
||||
Client * THIS;
|
||||
bool RETVAL;
|
||||
int spell_id = (int)SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == NULL)
|
||||
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->HasSpellScribed(spell_id);
|
||||
ST(0) = boolSV(RETVAL);
|
||||
sv_2mortal(ST(0));
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_SetAccountFlag); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_SetAccountFlag)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 3)
|
||||
Perl_croak(aTHX_ "Usage: Client::SetAccountFlag(THIS, flag, value)");
|
||||
{
|
||||
Client * THIS;
|
||||
//char* flag = (char *)SvPV_nolen(ST(1));
|
||||
//char* value = (char *)SvTRUE(ST(2));
|
||||
|
||||
std::string flag( (char *)SvPV_nolen(ST(1)) );
|
||||
std::string value( (char *)SvTRUE(ST(2)) );
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == NULL)
|
||||
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
|
||||
|
||||
THIS->SetAccountFlag(flag, value);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_GetAccountFlag); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_GetAccountFlag)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetAccountFlag(THIS, flag)");
|
||||
{
|
||||
Client * THIS;
|
||||
//char* flag = (char *)SvPV_nolen(ST(1));
|
||||
//char* value = (char *)SvTRUE(ST(2));
|
||||
|
||||
std::string flag( (char *)SvPV_nolen(ST(1)) );
|
||||
dXSTARG;
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if(THIS == NULL)
|
||||
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
|
||||
|
||||
std::string value = THIS->GetAccountFlag(flag);
|
||||
|
||||
sv_setpv(TARG, value.c_str()); XSprePUSH; PUSHTARG;
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
@@ -5877,6 +5962,9 @@ XS(boot_Client)
|
||||
newXSproto(strcpy(buf, "AddAlternateCurrencyValue"), XS_Client_AddAlternateCurrencyValue, file, "$$$");
|
||||
newXSproto(strcpy(buf, "SendWebLink"), XS_Client_SendWebLink, file, "$:$");
|
||||
newXSproto(strcpy(buf, "GetInstanceID"), XS_Client_GetInstanceID, file, "$$");
|
||||
newXSproto(strcpy(buf, "HasSpellScribed"), XS_Client_HasSkill, file, "$$");
|
||||
newXSproto(strcpy(buf, "SetAccountFlag"), XS_Client_SetAccountFlag, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetAccountFlag"), XS_Client_GetAccountFlag, file, "$$");
|
||||
XSRETURN_YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user