Changed EVENT_TRADE to pass iteminst instead of variable ids, perl will not have changed at all but lua now passes the iteminsts in the trade object. Also redid a bunch of the spell quest stuff

This commit is contained in:
KimLS
2013-06-05 16:47:49 -07:00
parent 6d0c0aee7d
commit a3738dc131
20 changed files with 428 additions and 248 deletions
+10 -3
View File
@@ -17,9 +17,12 @@ class Lua_ItemInst : public Lua_Ptr<void>
{
typedef ItemInst NativeType;
public:
Lua_ItemInst() : Lua_Ptr(nullptr) { }
Lua_ItemInst(ItemInst *d) : Lua_Ptr(d) { }
virtual ~Lua_ItemInst() { }
Lua_ItemInst(int item_id);
Lua_ItemInst(int item_id, int charges);
Lua_ItemInst() : Lua_Ptr(nullptr), cloned_(false) { }
Lua_ItemInst(ItemInst *d) : Lua_Ptr(d), cloned_(false) { }
Lua_ItemInst(ItemInst *d, bool cloned) : Lua_Ptr(d), cloned_(cloned) { }
virtual ~Lua_ItemInst() { if(cloned_) { void *ptr = GetLuaPtrData(); if(ptr) { delete ptr; } } }
operator ItemInst*() {
return reinterpret_cast<ItemInst*>(GetLuaPtrData());
@@ -66,6 +69,10 @@ public:
void AddExp(uint32 exp);
int GetMaxEvolveLvl();
uint32 GetKillsNeeded(int current_level);
Lua_ItemInst Clone();
private:
bool cloned_;
};
#endif