Merge branch 'ark'

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent d5c03115d9
commit 0f74f62640
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -1253,6 +1253,7 @@ CGameItemPtr CGameItem::getItemCopy()
item->_LostHPremains = 0.0f;
item->_PhraseId = _PhraseId;
item->_RequiredFaction = _RequiredFaction;
item->_RequiredPowo = _RequiredPowo;
item->computeItemWornState();
log_Item_Create(item->getItemId(), item->getSheetId(), item->getStackSize(), item->quality());
@ -1428,6 +1429,7 @@ void CGameItem::clear()
_TypeSkillMods.clear();
_PhraseId.clear();
_RequiredFaction.clear();
_RequiredPowo.clear();
_CustomText.clear();
}

@ -691,6 +691,11 @@ public :
/// set Required Faction
inline void setRequiredFaction(const std::string & str){ _RequiredFaction = str;}
/// get Required Powo
inline const std::string & getRequiredPowo() const { return _RequiredPowo;}
/// set Required Pow
inline void setRequiredPowo(const std::string & str){ _RequiredPowo = str;}
inline bool getLockedByOwner() const { return _LockedByOwner; }
void setLockedByOwner(bool value);
@ -964,6 +969,7 @@ private:
// required skill
bool _UseNewSystemRequirement;
std::string _RequiredFaction;
std::string _RequiredPowo;
SKILLS::ESkills _RequiredSkill;
uint16 _RequiredSkillLevel;
SKILLS::ESkills _RequiredSkill2;

@ -59,7 +59,7 @@ bool CMissionItem::buildFromScript(const std::vector<std::string> & script) {
MISLOG("Invalid sitem sheet '%s'", (script[0]+".sitem").c_str());
return false;
}
NLMISC::fromString(script[1], _Quality);
_NoDrop = script[2] == "0";
@ -67,7 +67,7 @@ bool CMissionItem::buildFromScript(const std::vector<std::string> & script) {
if (script.size() > 3) {
vector<string> vars;
NLMISC::splitString(script[3], ",", vars);
for (uint i = 0; i < vars.size(); i++)
{
vector<string> args;
@ -79,6 +79,10 @@ bool CMissionItem::buildFromScript(const std::vector<std::string> & script) {
_CustomName.fromUtf8(hex_decode(args[1]));
else if(!nlstricmp(args[0], "CustomText"))
_CustomText.fromUtf8(hex_decode(args[1]));
else if(!nlstricmp(args[0], "RequiredFaction"))
_RequiredFaction = args[1];
else if(!nlstricmp(args[0], "RequiredPowo"))
_RequiredPowo = args[1];
else
{
float value;
@ -189,7 +193,7 @@ bool CMissionItem::buildFromScript(const std::vector<std::string> & script) {
}
}
}
return true;
}// CMissionItem::buildFromScript
@ -223,7 +227,7 @@ CGameItemPtr CMissionItem::createItem(uint16 quantity)
nlwarning("<CMissionItem createItem> could not create mission item");
return NULL;
}
setItemParam(item);
return item;
}// CMissionItem::createItem
@ -274,6 +278,12 @@ void CMissionItem::setItemParam(CGameItemPtr item)
if (!_CustomName.empty())
item->setCustomName(_CustomName);
if (!_RequiredFaction.empty())
item->setRequiredFaction(_RequiredFaction);
if (!_RequiredPowo.empty())
item->setRequiredPowo(_RequiredPowo);
}
}// CMissionItem::setItemParam

@ -48,7 +48,7 @@ private:
// set a created item parameter
void setItemParam(CGameItemPtr item);
/// sheet describing the item type
NLMISC::CSheetId _SheetId;
/// parameters of the item
@ -63,6 +63,8 @@ private:
NLMISC::CSheetId _SPhraseId;
ucstring _CustomText;
ucstring _CustomName;
std::string _RequiredFaction;
std::string _RequiredPowo;
};

@ -825,7 +825,6 @@ NLMISC_COMMAND(getItemList, "get list of items of character by filter", "<uid> [
CInventoryPtr childSrc = c->getInventory(inventories[i]);
if (childSrc != NULL)
{
uint32 k = 0;
log.displayNL("#%s", INVENTORIES::toString(inventories[i]).c_str());
for (uint j = 0; j < childSrc->getSlotCount(); j++)
@ -1657,7 +1656,7 @@ NLMISC_COMMAND(setFaction, "set the faction of player", "<uid> <faction> [<civ>]
}
//----------------------------------------------------------------------------
NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> [playername] [instance] [exit_pos] [can_xp,cant_dead,can_teleport,can_speedup] [access_room_inv,access_guild_room] [scope]")
NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> [playername] [instance] [exit_pos] [can_xp,cant_dead,can_teleport,can_speedup,can_dp,onetry] [access_room_inv,access_guild_room] [scope]")
{
if (args.size() < 2)
return false;
@ -1670,12 +1669,12 @@ NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> [playername] [insta
else
building = CBuildingManager::getInstance()->getBuildingPhysicalsByName("building_instance_ZO_player_111");
string powoFlags = "0000";
if (args.size() > 4)
string powoFlags = "000000";
if (args.size() > 4 && args[4].length() == 6)
powoFlags = args[4];
string invFlags = "00";
if (args.size() > 5)
if (args.size() > 5 && args[5].length() == 2)
invFlags = args[5];
if (building)
@ -1701,9 +1700,12 @@ NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> [playername] [insta
c->setPowoScope(args[6]);
c->setPowoFlag("xp", powoFlags[0] == '1');
c->setPowoFlag("dead", powoFlags[1] == '1');
c->setPowoFlag("nodead", powoFlags[1] == '1');
c->setPowoFlag("teleport", powoFlags[2] == '1');
c->setPowoFlag("speed", powoFlags[3] == '1');
c->setPowoFlag("dp", powoFlags[4] == '1');
c->setPowoFlag("retry", powoFlags[5] == '1');
c->setPowoFlag("room_inv", invFlags[0] == '1');
c->setPowoFlag("guild_inv", invFlags[1] == '1');
@ -3357,6 +3359,8 @@ NLMISC_COMMAND(spawnPlayerPet, "spawn player pet", "<uid> <slot>")
uint32 index;
fromString(args[1], index);
c->setPetStatus(index, CPetAnimal::waiting_spawn);
c->updateOnePetDatabase(index, false);
c->removeAnimalIndex(index, CPetCommandMsg::DESPAWN);
c->setAnimalPosition(index, c->getState().X, c->getState().Y);
if (!c->spawnCharacterAnimal(index))

@ -573,7 +573,7 @@ CCharacter::CCharacter()
_DeathPenaltyTimer.setRemaining(1, new CDeathPenaltiesTimerEvent(this), 1);
_BarUpdateTimer.setRemaining(1, new CCharacterBarUpdateTimerEvent(this), 1);
_BuildingExitZone = 0xffff;
_BuildingExitPos = CVector();
_BuildingExitPos = CVector(0, 0, 0);
_BuildingExitPos.x = 0;
_BuildingExitPos.y = 0;
_RespawnMainLandInTown = false;
@ -5694,6 +5694,25 @@ void CCharacter::teleportCharacter(sint32 x, sint32 y, sint32 z, bool teleportWi
_PowoCell = 0;
CBuildingManager::getInstance()->removePlayerFromRoom(this, false);
getRespawnPoints().setArkRespawnpoint(0, 0, 0);
CInventoryPtr childSrc = getInventory(INVENTORIES::bag);
if (childSrc != NULL)
{
for (uint j = 0; j < childSrc->getSlotCount(); j++)
{
CGameItemPtr itemPtr = childSrc->getItem(j);
if (itemPtr != NULL)
{
if (!itemPtr->getRequiredPowo().empty())
{
if (itemPtr->getRequiredPowo() != _PowoScope)
GameItemManager.destroyItem(itemPtr);
else
unequipCharacter(childSrc->getInventoryId(), itemPtr->getRefInventorySlot());
}
}
}
}
}
else if (_PowoCell == 0)
CBuildingManager::getInstance()->removePlayerFromRoom(this);
@ -21313,7 +21332,6 @@ uint32 CPetAnimal::getAnimalMaxBulk()
if (formBag)
{
// zig inventories have bulk proportionnal to size (size is 1->250)
if (creatureBagSheet == CSheetId("zig_inventory.sitem"))
return formBag->BulkMax*1.5;
return formBag->BulkMax;

@ -4099,6 +4099,7 @@ private:
bool _PowoCanTeleport;
bool _PowoCanSpeedUp;
bool _PowoCanDP;
bool _PowoCanRetry;
bool _PowoCanAccesRoomInv;
bool _PowoCanAccessGuildInv;
@ -4160,7 +4161,7 @@ public:
if (flag == "xp")
return _PowoCanXP;
if (flag == "dead")
if (flag == "nodead")
return _PowoCantDead;
if (flag == "teleport")
@ -4172,6 +4173,9 @@ public:
if (flag == "dp")
return _PowoCanDP;
if (flag == "retry")
return _PowoCanRetry;
if (flag == "guild_inv")
return _PowoCanAccessGuildInv;
@ -4186,7 +4190,7 @@ public:
if (flag == "xp")
_PowoCanXP = value;
else if (flag == "dead")
else if (flag == "nodead")
_PowoCantDead = value;
else if (flag == "teleport")
@ -4198,6 +4202,9 @@ public:
else if (flag == "dp")
_PowoCanDP = value;
else if (flag == "retry")
_PowoCanRetry = value;
else if (flag == "guild_inv")
_PowoCanAccessGuildInv = value;
@ -4214,6 +4221,7 @@ public:
_PowoCanTeleport = false;
_PowoCanSpeedUp = false;
_PowoCanDP = false;
_PowoCanRetry = true;
}
void resetTodayGuildPoints()

@ -1388,6 +1388,7 @@ private:
PROP2(_CreatorId, CEntityId, _CreatorId, _CreatorId=val)\
PROP2(_PhraseId, string, _PhraseId, _PhraseId=val)\
PROP2(_RequiredFaction, string, _RequiredFaction, _RequiredFaction=val)\
PROP2(_RequiredPowo, string, _RequiredPowo, _RequiredPowo=val)\
LSTRUCT2(_CraftParameters, if (_CraftParameters != NULL), _CraftParameters->store(pdr), _CraftParameters = new CItemCraftParameters; _CraftParameters->apply(pdr))\
LPROP2(_SlotImage, uint16, if (0), 0xffff, slotImage=val)\
LPROP2(_SapLoad, uint32, if (_SapLoad!=0), _SapLoad, _SapLoad=val)\

Loading…
Cancel
Save