Experienced Elementalist
- Joined
- Oct 14, 2015
- Messages
- 267
- Reaction score
- 294
Requires Flash Source Files < Click here
If you are not using a custom FrontEnd you can get away with using this Published version with only the below changes made. >
--------
Stage 1 Editing Flash Files
--------
Stage 2 Editing the API
--------
Stage 3 Editing Function in Database
--------
Stage 4 Editing the Source
Client
Server
--------
* Confirmed Working *
Please post any errors you receive on this thread and will gladly fix these for you.
Hope it all works regardless or atleast helps you make progress getting this system running.
<3 Hit that Likes button
Special Thanks @erickstyle for posting a fix and the community for feeding back bugs.
If you are not using a custom FrontEnd you can get away with using this Published version with only the below changes made. >
You must be registered to see links
<--------
Stage 1 Editing Flash Files
Open src\classes\warz\events\charPopup.as
Find
Replace With
Open src\classes\warz\events\FrontEndEvents.as
Find
Replace With
Open src\classes\warz\frontend\MarketplaceScreen.as
Find
Add Below
Find
Replace With
Open src\Frontend.fla and Publish.
Find
if (xp)
FrontEndEvents.eventBuyItem (charID, 0, charStoreItem.priceGD);
else
FrontEndEvents.eventBuyItem (charID, charStoreItem.price, 0);
FrontEndEvents.eventBuyItem (charID, 0, charStoreItem.priceGD);
else
FrontEndEvents.eventBuyItem (charID, charStoreItem.price, 0);
if (xp)
FrontEndEvents.eventBuyItem (charID, 0, charStoreItem.priceGD, 1);
else
FrontEndEvents.eventBuyItem (charID, charStoreItem.price, 0 , 1);
FrontEndEvents.eventBuyItem (charID, 0, charStoreItem.priceGD, 1);
else
FrontEndEvents.eventBuyItem (charID, charStoreItem.price, 0 , 1);
Open src\classes\warz\events\FrontEndEvents.as
Find
public static function eventBuyItem (itemID:uint, price:int, priceGD:int)
{
send("eventBuyItem", itemID, price, priceGD);
}
{
send("eventBuyItem", itemID, price, priceGD);
}
public static function eventBuyItem (itemID:uint, price:int, priceGD:int, Quantity:int)
{
send("eventBuyItem", itemID, price, priceGD, Quantity);
}
{
send("eventBuyItem", itemID, price, priceGD, Quantity);
}
Open src\classes\warz\frontend\MarketplaceScreen.as
Find
private var transactionsData:Array = null;
private var BuyQuantity;
private var BuyItemID;
private var BuyGameDollar;
private var BuyGamePoints;
private var BuyItemID;
private var BuyGameDollar;
private var BuyGamePoints;
Find
public function ActionFunction (button:String)
{
....
}
{
....
}
public function ActionFunction (button:String)
{
if (button == "BuyBtn")
{
Marketplace.BuyBtn.State = "off";
Marketplace.BuyBtn.gotoAndPlay("out");
if (SelectedItem)
{
var item:Item = SelectedItem.Item;
var storeItem:StoreItem = SelectedItem.StoreItem;
if (api.isDebug)
{
var inventItem:InventoryItem = api.getInventoryItemByID (item.itemID);
if (inventItem)
{
inventItem.quantity += 1;
}
else
api.addInventoryItem(api.InventoryDB.length, item.itemID, 1, 0, 0, false);
api.money.gc -= storeItem.price;
api.money.dollars -= storeItem.priceGD;
api.buyItemSuccessful ()
}
else
{
BuyQuantity = 1;
BuyItemID = item.itemID;
BuyGameDollar = storeItem.priceGD;
BuyGamePoints = storeItem.price;
api.Main.MsgBox.showInfoInputMsg("How many would you like to buy?", "", eventBuyQtyCallback);
}
}
}
else if (button.indexOf("PopupSlot") != -1)
{
var slot = int (button.slice (9)) - 1;
var storeSlot = Marketplace.Slots.getChildAt(slot);
if (storeSlot)
{
showDescription (storeSlot);
}
}
else if (button.indexOf("Tab") != -1)
{
var tab = int (button.slice (3)) - 1;
var Name = "Tab" + (SelectedTabID + 1);
Marketplace[Name].State = "off";
Marketplace[Name].gotoAndPlay("out");
updateStoreItemsList (tab);
showDescription (null);
}
}
public function eventBuyQtyCallback (state:Boolean, text:String=""):void
{
if (state)
{
var q:uint = uint(text);
if(q>0)
FrontEndEvents.eventBuyItem (BuyItemID, BuyGamePoints, BuyGameDollar, q);
}
}
{
if (button == "BuyBtn")
{
Marketplace.BuyBtn.State = "off";
Marketplace.BuyBtn.gotoAndPlay("out");
if (SelectedItem)
{
var item:Item = SelectedItem.Item;
var storeItem:StoreItem = SelectedItem.StoreItem;
if (api.isDebug)
{
var inventItem:InventoryItem = api.getInventoryItemByID (item.itemID);
if (inventItem)
{
inventItem.quantity += 1;
}
else
api.addInventoryItem(api.InventoryDB.length, item.itemID, 1, 0, 0, false);
api.money.gc -= storeItem.price;
api.money.dollars -= storeItem.priceGD;
api.buyItemSuccessful ()
}
else
{
BuyQuantity = 1;
BuyItemID = item.itemID;
BuyGameDollar = storeItem.priceGD;
BuyGamePoints = storeItem.price;
api.Main.MsgBox.showInfoInputMsg("How many would you like to buy?", "", eventBuyQtyCallback);
}
}
}
else if (button.indexOf("PopupSlot") != -1)
{
var slot = int (button.slice (9)) - 1;
var storeSlot = Marketplace.Slots.getChildAt(slot);
if (storeSlot)
{
showDescription (storeSlot);
}
}
else if (button.indexOf("Tab") != -1)
{
var tab = int (button.slice (3)) - 1;
var Name = "Tab" + (SelectedTabID + 1);
Marketplace[Name].State = "off";
Marketplace[Name].gotoAndPlay("out");
updateStoreItemsList (tab);
showDescription (null);
}
}
public function eventBuyQtyCallback (state:Boolean, text:String=""):void
{
if (state)
{
var q:uint = uint(text);
if(q>0)
FrontEndEvents.eventBuyItem (BuyItemID, BuyGamePoints, BuyGameDollar, q);
}
}
Open src\Frontend.fla and Publish.
Stage 2 Editing the API
Open server\src\Scripts\WZBackend-ASP.NET\WZBackend-ASP.NET.sln
The files you will need open are: api_ClanMgr.aspx.cs, api_ClanCreate.aspx.cs, api_CharSlots.aspx.cs, api_BuyItem3.aspx.cs
Inside api_ClanMgr.aspx.cs;
Find
Add Below
Inside api_ClanCreate.aspx.cs;
Find
Add Below
Inside api_CharSlots.aspx.cs;
Find
Add Below
Inside api_BuyItem3.aspx.cs;
Find
Add Below
Find
Add Below
The files you will need open are: api_ClanMgr.aspx.cs, api_ClanCreate.aspx.cs, api_CharSlots.aspx.cs, api_BuyItem3.aspx.cs
Inside api_ClanMgr.aspx.cs;
Find
sqcmd.Parameters.AddWithValue("@in_BuyDays", 2000);
sqcmd.Parameters.AddWithValue("@in_Qty", 1);
Inside api_ClanCreate.aspx.cs;
Find
sqcmd.Parameters.AddWithValue("@in_BuyDays", 2000);
sqcmd.Parameters.AddWithValue("@in_Qty", 1);
Inside api_CharSlots.aspx.cs;
Find
sqcmd.Parameters.AddWithValue("@in_BuyDays", 2000);
sqcmd.Parameters.AddWithValue("@in_Qty", 1);
Inside api_BuyItem3.aspx.cs;
Find
string BuyIdx = web.Param("BuyIdx");
string Qty = web.Param("Qty");
Find
sqcmd.Parameters.AddWithValue("@in_BuyDays", BuyItem3.GetBuyDaysFromIdx(BuyIdx));
sqcmd.Parameters.AddWithValue("@in_Qty", Qty);
--------
Stage 3 Editing Function in Database
Open your Server DB
Open WarZ\Functions\WZ_BuyItemFN_Exec
Here is the full code
Open WarZ\Functions\WZ_BuyItem_GD
Here is the full code
Open WarZ\Functions\WZ_BuyItem_GP
Here is the full code
Open WarZ\Functions\WZ_BuyItemFN_Exec
Here is the full code
You must be registered to see links
Open WarZ\Functions\WZ_BuyItem_GD
Here is the full code
You must be registered to see links
Open WarZ\Functions\WZ_BuyItem_GP
Here is the full code
You must be registered to see links
Stage 4 Editing the Source
Client
Open FontEndWarZ.h
Find
Add Below
Open FrontEndWarZ.cpp :: eventBuyItem
Find
Add Below
Find (unsigned int WINAPI FrontendWarZ::as_BuyItemThread(void* in_data))
Replace With
Find
Replace With
Open UserProfile.cpp
Find
Replace With
Within (ApiBuyItem)
Find
Add Below
Open UserProfile.h
Find
Replace
Find
int mStore_BuyPriceGD;
int mStore_BuyQuantity;
Open FrontEndWarZ.cpp :: eventBuyItem
Find
mStore_BuyPriceGD = args[2].GetInt();
mStore_BuyQuantity = args[3].GetInt(); // new quantity code
mStore_BuyPrice *= mStore_BuyQuantity; // make price take into account the new quantity!
mStore_BuyPriceGD *= mStore_BuyQuantity; // make price take into account the new quantity!
mStore_BuyPrice *= mStore_BuyQuantity; // make price take into account the new quantity!
mStore_BuyPriceGD *= mStore_BuyQuantity; // make price take into account the new quantity!
Find (unsigned int WINAPI FrontendWarZ::as_BuyItemThread(void* in_data))
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID);
int apiCode = gUserProfile.ApiBuyItem(This->mStore_BuyItemID, buyIdx, &This->m_inventoryID, This->mStore_BuyQuantity);
Find
int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID);
int quantityToAdd = storecat_GetItemBuyStackSize(mStore_BuyItemID) * mStore_BuyQuantity;
Open UserProfile.cpp
Find
int CClientUserProfile::ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID)
int CClientUserProfile::ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID, int qty)
Within (ApiBuyItem)
Find
req.AddParam("BuyIdx", buyIdx);
req.AddParam("Qty", qty);
Open UserProfile.h
Find
int ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID);
int ApiBuyItem(int itemId, int buyIdx, __int64* out_InventoryID, int qty);
Server
Open AsyncFuncs.cpp
Find
Add Below
This will fix ingame store. As it does not yet have support for qty purchases will default to 1 / 1 stack.
Find
req.AddParam("BuyIdx", BuyIdx);
req.AddParam("Qty", 1);
* Confirmed Working *
Please post any errors you receive on this thread and will gladly fix these for you.
Hope it all works regardless or atleast helps you make progress getting this system running.
<3 Hit that Likes button
Special Thanks @erickstyle for posting a fix and the community for feeding back bugs.
Last edited: