对Azerothcore进行重新构造(Rochet2)
Reforging (Rochet2) to AzerothCore
是否有人已经成功地在AC上添加了Rochet2的Refor脚本?我的工作,但不完全。在字符登录时,脚本应在重新添加(配备的)项目上重新应用奖金,但似乎" player-> getItembyGuid()"找不到请求的项目,所以它没有返回。
三位一体代码(工作):
uint32 lowGUID = (*result)[0].GetUInt32();
Item* invItem = player->GetItemByGuid(ObjectGuid(HighGuid::Item, 0, lowGUID));
if (invItem)
player->_ApplyItemMods(invItem, invItem->GetSlot(), false);
ReforgeData& data = player->reforgeMap[lowGUID];
data.increase = (*result)[1].GetUInt32();
data.decrease = (*result)[2].GetUInt32();
data.stat_value = (*result)[3].GetInt32();
if (invItem)
player->_ApplyItemMods(invItem, invItem->GetSlot(), true);
aszerothcore代码(有效,但"如果(Invitem)"条件从未满足。
uint32 lowGUID = (*result)[0].GetUInt32();
Item* invItem = player->GetItemByGuid((uint64) MAKE_NEW_GUID(HIGHGUID_ITEM, 0, lowGUID));
if (invItem /*&& invItem->IsEquipped()*/)
player->_ApplyItemMods(invItem, invItem->GetSlot(), false);
ReforgeData& data = player->reforgeMap[lowGUID];
data.increase = (*result)[1].GetUInt32();
data.decrease = (*result)[2].GetUInt32();
data.stat_value = (*result)[3].GetInt32();
if (invItem /*&& invItem->IsEquipped()*/)
player->_ApplyItemMods(invItem, invItem->GetSlot(), true);
make_new_guid()返回看起来像GUID的东西。
但我不知道为什么" player-> getItembyGuid()"找不到项目。
MAKE_NEW_GUID
的参数顺序与ObjectGuid
构造函数不同。因此,由于您的论点是错误的顺序,因此结果也是错误的,找不到项目。有关参数的正确顺序,请参见MAKE_NEW_GUID
的定义和使用。
相关文章:
- 是什么让放置新调用对象的构造函数?
- 如果我真的真的想从 STL 容器继承,并且我继承构造函数并删除新运算符,会发生什么?
- 将放置新与存储类一起使用时的额外构造
- 如何在C++中将构造函数的新输入推回构造函数的默认输入?
- 在 C++ 中返回新的构造函数(*this)工厂
- 动态构造函数中的新字符 [] 抛出"损坏的顶部大小";
- 正在通过const-ref未定义的行为捕获新构造的对象
- 从类重载的新运算符运行非默认构造函数
- 为什么我丢失了这些带有智能指针的构造对象,而不是新的?
- 如何从构造函数声明新的私有变量?
- 有没有办法初始化不涉及编写构造函数的新结构变量?
- 具有构造函数的新对象数组,需要在C++中设置参数
- 如何销毁通过"放置新"构造的无析构函数类型
- 新构造的对象作为默认模板函数参数
- 派生类的新构造函数未生成:"overloaded member function not found"
- 将类构造函数分配给具有参数的新构造函数C++
- 模板化函数和放置新构造函数参数
- 构造函数与新构造函数
- c++如何阅读这个创建新构造函数的代码
- 初始化现有变量/对象的新构造函数