|
|
|
@ -1015,7 +1015,7 @@ NLMISC_COMMAND(deleteInventoryItems, "Delete items from a characters inventory",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <sheet1>,[<sheet2> ...]")
|
|
|
|
|
NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <sheet1>,[<sheet2> ...] [<maxSpaLoad>]")
|
|
|
|
|
{
|
|
|
|
|
if (args.size () < 3)
|
|
|
|
|
{
|
|
|
|
@ -1027,13 +1027,13 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <shee
|
|
|
|
|
|
|
|
|
|
string selected_slot = args[1];
|
|
|
|
|
|
|
|
|
|
std::vector<string> sheet_names;
|
|
|
|
|
NLMISC::splitString(args[2], ",", sheet_names);
|
|
|
|
|
|
|
|
|
|
std::vector<CSheetId> sheets;
|
|
|
|
|
for (uint32 i=0; i<sheet_names.size(); i++)
|
|
|
|
|
if (args[2] != "*")
|
|
|
|
|
{
|
|
|
|
|
sheets.push_back(CSheetId(sheet_names[i]));
|
|
|
|
|
std::vector<string> sheet_names;
|
|
|
|
|
NLMISC::splitString(args[2], ",", sheet_names);
|
|
|
|
|
for (uint32 i=0; i<sheet_names.size(); i++)
|
|
|
|
|
sheets.push_back(CSheetId(sheet_names[i]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CGameItemPtr itemPtr = c->getItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot));
|
|
|
|
@ -1041,6 +1041,14 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <shee
|
|
|
|
|
{
|
|
|
|
|
itemPtr->applyEnchantment(sheets);
|
|
|
|
|
c->updateJewelsTags(false);
|
|
|
|
|
|
|
|
|
|
if (args.size() > 3)
|
|
|
|
|
{
|
|
|
|
|
float maxSapLoad;
|
|
|
|
|
fromString(args[3], maxSapLoad);
|
|
|
|
|
itemPtr->setMaxSapLoad(maxSapLoad);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.displayNL("OK");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1048,7 +1056,72 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <shee
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
NLMISC_COMMAND(getEnchantmentInEquipedItem, "getEnchantmentInEquipedItem", "<uid> <slotname>")
|
|
|
|
|
{
|
|
|
|
|
if (args.size () < 2)
|
|
|
|
|
{
|
|
|
|
|
log.displayNL("ERR: Invalid number of parameters. Parameters: <uid> <slotname>");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GET_ACTIVE_CHARACTER
|
|
|
|
|
|
|
|
|
|
string selected_slot = args[1];
|
|
|
|
|
|
|
|
|
|
CGameItemPtr itemPtr = c->getItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot));
|
|
|
|
|
if (itemPtr != NULL)
|
|
|
|
|
{
|
|
|
|
|
const std::vector<CSheetId> &sheets = itemPtr->getEnchantment();
|
|
|
|
|
for (uint32 i=0; i<sheets.size(); i++)
|
|
|
|
|
log.displayNL("%s", sheets[i].toString().c_str());
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
NLMISC_COMMAND(sapLoadInEquipedItem, "reloadSapLoadInEquipedItem", "<uid> <slotname> [<value>]")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (args.size () < 2)
|
|
|
|
|
{
|
|
|
|
|
log.displayNL("ERR: invalid arg count");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GET_ACTIVE_CHARACTER
|
|
|
|
|
|
|
|
|
|
string selected_slot = args[1];
|
|
|
|
|
|
|
|
|
|
CGameItemPtr itemPtr = c->getItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot));
|
|
|
|
|
if (itemPtr != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (args.size() >= 3)
|
|
|
|
|
{
|
|
|
|
|
string quant = args[2];
|
|
|
|
|
uint32 quantity;
|
|
|
|
|
if (quant[0] == '-')
|
|
|
|
|
{
|
|
|
|
|
if (quant.size() > 1)
|
|
|
|
|
{
|
|
|
|
|
fromString(quant.substr(1), quantity);
|
|
|
|
|
itemPtr->consumeSapLoad(quantity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fromString(quant, quantity);
|
|
|
|
|
itemPtr->reloadSapLoad(quantity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32 sapLoad = itemPtr->sapLoad();
|
|
|
|
|
uint32 max = itemPtr->maxSapLoad();
|
|
|
|
|
log.displayNL("%u / %u", sapLoad, max);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
@ -4173,15 +4246,15 @@ NLMISC_COMMAND(closeDynChat, "close DynChat", "<uid> <process missions?>")
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action> <value>")
|
|
|
|
|
{
|
|
|
|
|
if (args.size() < 2) return false;
|
|
|
|
|
if (args.size() < 3) return false;
|
|
|
|
|
|
|
|
|
|
GET_ACTIVE_CHARACTER
|
|
|
|
|
|
|
|
|
|
string action = args[1]; // trigger_in, trigger_out, add_guild_room, add_player_room
|
|
|
|
|
|
|
|
|
|
if (action == "trigger_in" && args.size() == 3)
|
|
|
|
|
if (action == "trigger_in")
|
|
|
|
|
{
|
|
|
|
|
uint32 liftId;
|
|
|
|
|
NLMISC::fromString(args[2], liftId);
|
|
|
|
@ -4192,7 +4265,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
CBuildingManager::getInstance()->removeTriggerRequest(c->getEntityRowId());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (action == "add_guild_room" && args.size() == 3)
|
|
|
|
|
else if (action == "add_guild_room")
|
|
|
|
|
{
|
|
|
|
|
CBuildingPhysicalGuild * building = dynamic_cast<CBuildingPhysicalGuild *>(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2]));
|
|
|
|
|
if (building)
|
|
|
|
@ -4203,7 +4276,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (action == "add_player_room" && args.size () == 3)
|
|
|
|
|
else if (action == "add_player_room")
|
|
|
|
|
{
|
|
|
|
|
CBuildingPhysicalPlayer * building = dynamic_cast<CBuildingPhysicalPlayer *>(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2]));
|
|
|
|
|
if (building)
|
|
|
|
@ -4214,7 +4287,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (action == "buy_guild_room" && args.size () == 3)
|
|
|
|
|
else if (action == "buy_guild_room")
|
|
|
|
|
{
|
|
|
|
|
CBuildingPhysicalGuild * building = dynamic_cast<CBuildingPhysicalGuild *>(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2]));
|
|
|
|
|
if (building)
|
|
|
|
@ -4229,7 +4302,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (action == "buy_player_room" && args.size () == 3)
|
|
|
|
|
else if (action == "buy_player_room")
|
|
|
|
|
{
|
|
|
|
|
CBuildingPhysicalPlayer * building = dynamic_cast<CBuildingPhysicalPlayer *>(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2]));
|
|
|
|
|
if ( building )
|
|
|
|
@ -4240,7 +4313,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (action == "set_player_room" && args.size () == 3)
|
|
|
|
|
else if (action == "set_player_room")
|
|
|
|
|
{
|
|
|
|
|
/* CBuildingPhysicalPlayer * building = dynamic_cast<CBuildingPhysicalPlayer *>(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2]));
|
|
|
|
|
if ( building )
|
|
|
|
@ -4254,7 +4327,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
|
|
|
|
|
return true;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
else if (action == "get_access_room" && args.size () == 3)
|
|
|
|
|
else if (action == "get_access_room")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CCharacter *owner = PlayerManager.getCharacterByName(CShardNames::getInstance().makeFullNameFromRelative(c->getHomeMainlandSessionId(), args[2]));
|
|
|
|
|