mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
Merge branch 'master' into raycast
This commit is contained in:
+52
-9
@@ -449,7 +449,11 @@ int command_init(void) {
|
||||
command_add("questerrors", "Shows quest errors.", 100, command_questerrors) ||
|
||||
command_add("enablerecipe", "[recipe_id] - Enables a recipe using the recipe id.", 80, command_enablerecipe) ||
|
||||
command_add("disablerecipe", "[recipe_id] - Disables a recipe using the recipe id.", 80, command_disablerecipe) ||
|
||||
command_add("npctype_cache", "[id] or all - Clears the npc type cache for either the id or all npcs.", 250, command_npctype_cache)
|
||||
command_add("npctype_cache", "[id] or all - Clears the npc type cache for either the id or all npcs.", 250, command_npctype_cache) ||
|
||||
command_add("merchant_open_shop", "Opens a merchants shop", 100, command_merchantopenshop) ||
|
||||
command_add("open_shop", nullptr, 100, command_merchantopenshop) ||
|
||||
command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) ||
|
||||
command_add("close_shop", nullptr, 100, command_merchantcloseshop)
|
||||
)
|
||||
{
|
||||
command_deinit();
|
||||
@@ -2638,19 +2642,35 @@ void command_makepet(Client *c, const Seperator *sep)
|
||||
void command_level(Client *c, const Seperator *sep)
|
||||
{
|
||||
uint16 level = atoi(sep->arg[1]);
|
||||
if ((level <= 0) || ((level > RuleI(Character, MaxLevel)) && (c->Admin() < commandLevelAboveCap)) )
|
||||
|
||||
if ((level <= 0) || ((level > RuleI(Character, MaxLevel)) && (c->Admin() < commandLevelAboveCap))) {
|
||||
c->Message(0, "Error: #Level: Invalid Level");
|
||||
else if (c->Admin() < 100)
|
||||
}
|
||||
else if (c->Admin() < 100) {
|
||||
c->SetLevel(level, true);
|
||||
else if (!c->GetTarget())
|
||||
#ifdef BOTS
|
||||
if(RuleB(Bots, BotLevelsWithOwner))
|
||||
Bot::LevelBotWithClient(c, level, true);
|
||||
#endif
|
||||
}
|
||||
else if (!c->GetTarget()) {
|
||||
c->Message(0, "Error: #Level: No target");
|
||||
else
|
||||
if (!c->GetTarget()->IsNPC() && ((c->Admin() < commandLevelNPCAboveCap) && (level > RuleI(Character, MaxLevel))))
|
||||
}
|
||||
else {
|
||||
if (!c->GetTarget()->IsNPC() && ((c->Admin() < commandLevelNPCAboveCap) && (level > RuleI(Character, MaxLevel)))) {
|
||||
c->Message(0, "Error: #Level: Invalid Level");
|
||||
else
|
||||
}
|
||||
else {
|
||||
c->GetTarget()->SetLevel(level, true);
|
||||
if(c->GetTarget() && c->GetTarget()->IsClient())
|
||||
c->GetTarget()->CastToClient()->SendLevelAppearance();
|
||||
if(c->GetTarget()->IsClient()) {
|
||||
c->GetTarget()->CastToClient()->SendLevelAppearance();
|
||||
#ifdef BOTS
|
||||
if(RuleB(Bots, BotLevelsWithOwner))
|
||||
Bot::LevelBotWithClient(c->GetTarget()->CastToClient(), level, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void command_spawn(Client *c, const Seperator *sep)
|
||||
@@ -11465,3 +11485,26 @@ void command_npctype_cache(Client *c, const Seperator *sep)
|
||||
c->Message(0, "#npctype_cache all");
|
||||
}
|
||||
}
|
||||
|
||||
void command_merchantopenshop(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *merchant = c->GetTarget();
|
||||
if (!merchant || merchant->GetClass() != MERCHANT) {
|
||||
c->Message(0, "You must target a merchant to open their shop.");
|
||||
return;
|
||||
}
|
||||
|
||||
merchant->CastToNPC()->MerchantOpenShop();
|
||||
}
|
||||
|
||||
void command_merchantcloseshop(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *merchant = c->GetTarget();
|
||||
if (!merchant || merchant->GetClass() != MERCHANT) {
|
||||
c->Message(0, "You must target a merchant to close their shop.");
|
||||
return;
|
||||
}
|
||||
|
||||
merchant->CastToNPC()->MerchantCloseShop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user