Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FrontendWarZ::OnBuyLootBoxSuccess()
- {
- if(gUserProfile.ProfileData.lastWinID > 0)
- {
- char winmsg[600];
- const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(gUserProfile.ProfileData.lastWinID);
- const GearConfig* gc = g_pWeaponArmory->getGearConfig(gUserProfile.ProfileData.lastWinID);
- const FoodConfig* fc = g_pWeaponArmory->getFoodConfig(gUserProfile.ProfileData.lastWinID);
- const BaseItemConfig* ic = g_pWeaponArmory->getFoodConfig(gUserProfile.ProfileData.lastWinID);
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/lever8"), r3dPoint3D(0,0,0));
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/csgo_ui_crate_open"), r3dPoint3D(0,0,0));
- if(wc)
- {
- sprintf(winmsg, "CONGRATULATIONS\n YOU FOUND A <font color=\"#6496FF\">%s</font>\n IT CAN BE FOUND IN YOUR GLOBAL INVENTORY", wc->m_StoreName);
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/item_drop2_uncommon"), r3dPoint3D(0,0,0));
- }
- else if(gc)
- {
- sprintf(winmsg, "CONGRATULATIONS\n YOU FOUND A <font color=\"#6496FF\">%s</font>\n IT CAN BE FOUND IN YOUR GLOBAL INVENTORY", gc->m_StoreName);
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/item_drop2_uncommon"), r3dPoint3D(0,0,0));
- }
- else if(fc)
- {
- sprintf(winmsg, "CONGRATULATIONS\n YOU FOUND A <font color=\"#6496FF\">%s</font>\n IT CAN BE FOUND IN YOUR GLOBAL INVENTORY", fc->m_StoreName);
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/item_drop2_uncommon"), r3dPoint3D(0,0,0));
- }
- else if(ic)
- {
- sprintf(winmsg, "CONGRATULATIONS\n YOU FOUND A <font color=\"#6496FF\">%s</font>\n IT CAN BE FOUND IN YOUR GLOBAL INVENTORY", ic->m_StoreName);
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/item_drop2_uncommon"), r3dPoint3D(0,0,0));
- }
- else
- {
- sprintf(winmsg, "OH FIDDLESTICKS\n YOU FOUND <font color=\"#FF6464\">NOTHING</font> IN THAT CASE\n I BETTER LUCK NEXT TIME");
- SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/PandemicZ/Crate/item_drop2_uncommon"), r3dPoint3D(0,0,0));
- }
- gfxMovie.Invoke("_root.api.Main.Marketplace.showTransactionsPopup", "");
- gfxMovie.Invoke("_root.api.Main.Marketplace.Marketplace.openCase", "");
- //setCurrency();
- gUserProfile.GetProfile();
- Scaleform::GFx::Value var3[1];
- var3[0].SetInt(gUserProfile.ProfileData.GamePoints);
- gfxMovie.Invoke("_root.api.setGC", var3, 1);
- var3[0].SetInt(gUserProfile.ProfileData.GameDollars);
- gfxMovie.Invoke("_root.api.setDollars", var3, 1);
- /*var3[0].SetInt(gUserProfile.ProfileData.GameCells);
- gfxMovie.Invoke("_root.api.setCells", var3, 1);*/
- Scaleform::GFx::Value var2[7];
- // clear inventory DB
- gfxMovie.Invoke("_root.api.clearInventory", NULL, 0);
- // add all items
- for(uint32_t i=0; i<gUserProfile.ProfileData.NumItems; ++i)
- {
- var2[0].SetUInt(uint32_t(gUserProfile.ProfileData.Inventory[i].InventoryID));
- var2[1].SetUInt(gUserProfile.ProfileData.Inventory[i].itemID);
- var2[2].SetNumber(gUserProfile.ProfileData.Inventory[i].quantity);
- var2[3].SetNumber(gUserProfile.ProfileData.Inventory[i].Var1);
- var2[4].SetNumber(gUserProfile.ProfileData.Inventory[i].Var2);
- bool isConsumable = false;
- {
- const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(gUserProfile.ProfileData.Inventory[i].itemID);
- if(wc && wc->category == storecat_UsableItem && wc->m_isConsumable)
- isConsumable = true;
- }
- var2[5].SetBoolean(isConsumable);
- var2[6].SetString(getAdditionalDescForItem(gUserProfile.ProfileData.Inventory[i].itemID, gUserProfile.ProfileData.Inventory[i].Var1, gUserProfile.ProfileData.Inventory[i].Var2, gUserProfile.ProfileData.Inventory[i].Var3));
- gfxMovie.Invoke("_root.api.addInventoryItem", var2, 7);
- }
- gfxMovie.Invoke("_root.api.buyItemSuccessful", "");
- gfxMovie.Invoke("_root.api.hideInfoMsg", "");
- /*Scaleform::GFx::Value var[2];
- var[0].SetString(winmsg);
- var[1].SetBoolean(true);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- /*Scaleform::GFx::Value var[3];
- var[0].SetString(winmsg);
- var[1].SetString(winmsg);
- var[2].SetString(winmsg);
- gfxMovie.Invoke("_root.api.Main.Marketplace.setCaseData", var, 3);
- gfxMovie.Invoke("_root.api.Main.Marketplace.Marketplace.OpenCase.visible", true);*/
- }
- else
- {
- gfxMovie.Invoke("_root.api.buyItemSuccessful", "");
- gfxMovie.Invoke("_root.api.hideInfoMsg", "");
- Scaleform::GFx::Value var[2];
- var[0].SetString("Failed to open case");
- var[1].SetBoolean(true);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- }
- mStore_BuyItemID = 0;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement