Making Capturable PVP zones menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Spitfire103's Avatar Private
    Reputation
    7
    Join Date
    May 2011
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making Capturable PVP zones

    I'm confused at the code below inside the Player.cpp file. Most in particular this little tidbit.

    Code:
    data << uint32(0xa58) << uint32(0x0);
    If anyone has any experience working with the outdoorPvP code or has an idea as to what this does it would be appriciated

    Code:
    void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
    {
        // data depends on zoneid/mapid...
        Battleground* bg = GetBattleground();
        uint16 NumberOfFields = 0;
        uint32 mapid = GetMapId();
        OutdoorPvP * pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid);
        InstanceScript* instance = GetInstanceScript();
    
        sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid);
    
        // may be exist better way to do this...
        switch (zoneid)
        {
            case 0:
            case 1:
            case 4:
            case 8:
            case 10:
            case 11:
            case 12:
            case 36:
            case 38:
            case 40:
            case 41:
            case 51:
            case 267:
            case 1519:
            case 1537:
            case 2257:
            case 2918:
                NumberOfFields = 8;
                break;
            case 139:
                NumberOfFields = 41;
                break;
            case 1377:
                NumberOfFields = 15;
                break;
            case 2597:
                NumberOfFields = 83;
                break;
            case 3277:
                NumberOfFields = 16;
                break;
            case 3358:
            case 3820:
                NumberOfFields = 40;
                break;
            case 3483:
                NumberOfFields = 27;
                break;
            case 3518:
                NumberOfFields = 39;
                break;
            case 3519:
                NumberOfFields = 38;
                break;
            case 3521:
                NumberOfFields = 37;
                break;
            case 3698:
            case 3702:
            case 3968:
                NumberOfFields = 11;
                break;
            case 4378:
                NumberOfFields = 11;
                break;
            case 3703:
                NumberOfFields = 11;
                break;
            case 4384:
                NumberOfFields = 30;
                break;
            case 4710:
                NumberOfFields = 28;
                break;
            case 4812:  // Icecrown Citadel
                NumberOfFields = 13;
                break;
            case 4100:  // The Culling of Stratholme
                NumberOfFields = 13;
                break;
             default:
                NumberOfFields = 12;
                break;
        }
    
        WorldPacket data(SMSG_INIT_WORLD_STATES, (4+4+4+2+(NumberOfFields*8)));
        data << uint32(mapid);                                  // mapid
        data << uint32(zoneid);                                 // zone id
        data << uint32(areaid);                                 // area id, new 2.1.0
        data << uint16(NumberOfFields);                         // count of uint64 blocks
        data << uint32(0x8d8) << uint32(0x0);                   // 1
        data << uint32(0x8d7) << uint32(0x0);                   // 2
        data << uint32(0x8d6) << uint32(0x0);                   // 3
        data << uint32(0x8d5) << uint32(0x0);                   // 4
        data << uint32(0x8d4) << uint32(0x0);                   // 5
        data << uint32(0x8d3) << uint32(0x0);                   // 6
                                                                // 7 1 - Arena season in progress, 0 - end of season
        data << uint32(0xC77) << uint32(sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
                                                                // 8 Arena season id
        data << uint32(0xF3D) << uint32(sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID));
    
        if (mapid == 530)                                       // Outland
        {
            data << uint32(0x9bf) << uint32(0x0);               // 7
            data << uint32(0x9bd) << uint32(0xF);               // 8
            data << uint32(0x9bb) << uint32(0xF);               // 9
        }
    
        // insert <field> <value>
        switch (zoneid)
        {
            case 1:                                             // Dun Morogh
            case 11:                                            // Wetlands
            case 12:                                            // Elwynn Forest
            case 38:                                            // Loch Modan
            case 40:                                            // Westfall
            case 51:                                            // Searing Gorge
            case 1519:                                          // Stormwind City
            case 1537:                                          // Ironforge
            case 2257:                                          // Deeprun Tram
                break;
            case 139:                                           // Eastern Plaguelands
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x97a) << uint32(0x0); // 10 2426
                    data << uint32(0x917) << uint32(0x0); // 11 2327
                    data << uint32(0x918) << uint32(0x0); // 12 2328
                    data << uint32(0x97b) << uint32(0x32); // 13 2427
                    data << uint32(0x97c) << uint32(0x32); // 14 2428
                    data << uint32(0x933) << uint32(0x1); // 15 2355
                    data << uint32(0x946) << uint32(0x0); // 16 2374
                    data << uint32(0x947) << uint32(0x0); // 17 2375
                    data << uint32(0x948) << uint32(0x0); // 18 2376
                    data << uint32(0x949) << uint32(0x0); // 19 2377
                    data << uint32(0x94a) << uint32(0x0); // 20 2378
                    data << uint32(0x94b) << uint32(0x0); // 21 2379
                    data << uint32(0x932) << uint32(0x0); // 22 2354
                    data << uint32(0x934) << uint32(0x0); // 23 2356
                    data << uint32(0x935) << uint32(0x0); // 24 2357
                    data << uint32(0x936) << uint32(0x0); // 25 2358
                    data << uint32(0x937) << uint32(0x0); // 26 2359
                    data << uint32(0x938) << uint32(0x0); // 27 2360
                    data << uint32(0x939) << uint32(0x1); // 28 2361
                    data << uint32(0x930) << uint32(0x1); // 29 2352
                    data << uint32(0x93a) << uint32(0x0); // 30 2362
                    data << uint32(0x93b) << uint32(0x0); // 31 2363
                    data << uint32(0x93c) << uint32(0x0); // 32 2364
                    data << uint32(0x93d) << uint32(0x0); // 33 2365
                    data << uint32(0x944) << uint32(0x0); // 34 2372
                    data << uint32(0x945) << uint32(0x0); // 35 2373
                    data << uint32(0x931) << uint32(0x1); // 36 2353
                    data << uint32(0x93e) << uint32(0x0); // 37 2366
                    data << uint32(0x931) << uint32(0x1); // 38 2367 ??  grey horde not in dbc! send for consistency's sake, and to match field count
                    data << uint32(0x940) << uint32(0x0); // 39 2368
                    data << uint32(0x941) << uint32(0x0); // 7 2369
                    data << uint32(0x942) << uint32(0x0); // 8 2370
                    data << uint32(0x943) << uint32(0x0); // 9 2371
                }
                break;
            case 1377:                                          // Silithus
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_SI)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    // states are always shown
                    data << uint32(2313) << uint32(0x0); // 7 ally silityst gathered
                    data << uint32(2314) << uint32(0x0); // 8 horde silityst gathered
                    data << uint32(2317) << uint32(0x0); // 9 max silithyst
                }
                // dunno about these... aq opening event maybe?
                data << uint32(2322) << uint32(0x0); // 10 sandworm N
                data << uint32(2323) << uint32(0x0); // 11 sandworm S
                data << uint32(2324) << uint32(0x0); // 12 sandworm SW
                data << uint32(2325) << uint32(0x0); // 13 sandworm E
                break;
            case 2597:                                          // Alterac Valley
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_AV)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x7ae) << uint32(0x1);           // 7 snowfall n
                    data << uint32(0x532) << uint32(0x1);           // 8 frostwolfhut hc
                    data << uint32(0x531) << uint32(0x0);           // 9 frostwolfhut ac
                    data << uint32(0x52e) << uint32(0x0);           // 10 stormpike firstaid a_a
                    data << uint32(0x571) << uint32(0x0);           // 11 east frostwolf tower horde assaulted -unused
                    data << uint32(0x570) << uint32(0x0);           // 12 west frostwolf tower horde assaulted - unused
                    data << uint32(0x567) << uint32(0x1);           // 13 frostwolfe c
                    data << uint32(0x566) << uint32(0x1);           // 14 frostwolfw c
                    data << uint32(0x550) << uint32(0x1);           // 15 irondeep (N) ally
                    data << uint32(0x544) << uint32(0x0);           // 16 ice grave a_a
                    data << uint32(0x536) << uint32(0x0);           // 17 stormpike grave h_c
                    data << uint32(0x535) << uint32(0x1);           // 18 stormpike grave a_c
                    data << uint32(0x518) << uint32(0x0);           // 19 stoneheart grave a_a
                    data << uint32(0x517) << uint32(0x0);           // 20 stoneheart grave h_a
                    data << uint32(0x574) << uint32(0x0);           // 21 1396 unk
                    data << uint32(0x573) << uint32(0x0);           // 22 iceblood tower horde assaulted -unused
                    data << uint32(0x572) << uint32(0x0);           // 23 towerpoint horde assaulted - unused
                    data << uint32(0x56f) << uint32(0x0);           // 24 1391 unk
                    data << uint32(0x56e) << uint32(0x0);           // 25 iceblood a
                    data << uint32(0x56d) << uint32(0x0);           // 26 towerp a
                    data << uint32(0x56c) << uint32(0x0);           // 27 frostwolfe a
                    data << uint32(0x56b) << uint32(0x0);           // 28 froswolfw a
                    data << uint32(0x56a) << uint32(0x1);           // 29 1386 unk
                    data << uint32(0x569) << uint32(0x1);           // 30 iceblood c
                    data << uint32(0x568) << uint32(0x1);           // 31 towerp c
                    data << uint32(0x565) << uint32(0x0);           // 32 stoneh tower a
                    data << uint32(0x564) << uint32(0x0);           // 33 icewing tower a
                    data << uint32(0x563) << uint32(0x0);           // 34 dunn a
                    data << uint32(0x562) << uint32(0x0);           // 35 duns a
                    data << uint32(0x561) << uint32(0x0);           // 36 stoneheart bunker alliance assaulted - unused
                    data << uint32(0x560) << uint32(0x0);           // 37 icewing bunker alliance assaulted - unused
                    data << uint32(0x55f) << uint32(0x0);           // 38 dunbaldar south alliance assaulted - unused
                    data << uint32(0x55e) << uint32(0x0);           // 39 dunbaldar north alliance assaulted - unused
                    data << uint32(0x55d) << uint32(0x0);           // 40 stone tower d
                    data << uint32(0x3c6) << uint32(0x0);           // 41 966 unk
                    data << uint32(0x3c4) << uint32(0x0);           // 42 964 unk
                    data << uint32(0x3c2) << uint32(0x0);           // 43 962 unk
                    data << uint32(0x516) << uint32(0x1);           // 44 stoneheart grave a_c
                    data << uint32(0x515) << uint32(0x0);           // 45 stonheart grave h_c
                    data << uint32(0x3b6) << uint32(0x0);           // 46 950 unk
                    data << uint32(0x55c) << uint32(0x0);           // 47 icewing tower d
                    data << uint32(0x55b) << uint32(0x0);           // 48 dunn d
                    data << uint32(0x55a) << uint32(0x0);           // 49 duns d
                    data << uint32(0x559) << uint32(0x0);           // 50 1369 unk
                    data << uint32(0x558) << uint32(0x0);           // 51 iceblood d
                    data << uint32(0x557) << uint32(0x0);           // 52 towerp d
                    data << uint32(0x556) << uint32(0x0);           // 53 frostwolfe d
                    data << uint32(0x555) << uint32(0x0);           // 54 frostwolfw d
                    data << uint32(0x554) << uint32(0x1);           // 55 stoneh tower c
                    data << uint32(0x553) << uint32(0x1);           // 56 icewing tower c
                    data << uint32(0x552) << uint32(0x1);           // 57 dunn c
                    data << uint32(0x551) << uint32(0x1);           // 58 duns c
                    data << uint32(0x54f) << uint32(0x0);           // 59 irondeep (N) horde
                    data << uint32(0x54e) << uint32(0x0);           // 60 irondeep (N) ally
                    data << uint32(0x54d) << uint32(0x1);           // 61 mine (S) neutral
                    data << uint32(0x54c) << uint32(0x0);           // 62 mine (S) horde
                    data << uint32(0x54b) << uint32(0x0);           // 63 mine (S) ally
                    data << uint32(0x545) << uint32(0x0);           // 64 iceblood h_a
                    data << uint32(0x543) << uint32(0x1);           // 65 iceblod h_c
                    data << uint32(0x542) << uint32(0x0);           // 66 iceblood a_c
                    data << uint32(0x540) << uint32(0x0);           // 67 snowfall h_a
                    data << uint32(0x53f) << uint32(0x0);           // 68 snowfall a_a
                    data << uint32(0x53e) << uint32(0x0);           // 69 snowfall h_c
                    data << uint32(0x53d) << uint32(0x0);           // 70 snowfall a_c
                    data << uint32(0x53c) << uint32(0x0);           // 71 frostwolf g h_a
                    data << uint32(0x53b) << uint32(0x0);           // 72 frostwolf g a_a
                    data << uint32(0x53a) << uint32(0x1);           // 73 frostwolf g h_c
                    data << uint32(0x539) << uint32(0x0);           // 74 frostwolf g a_c
                    data << uint32(0x538) << uint32(0x0);           // 75 stormpike grave h_a
                    data << uint32(0x537) << uint32(0x0);           // 76 stormpike grave a_a
                    data << uint32(0x534) << uint32(0x0);           // 77 frostwolf hut h_a
                    data << uint32(0x533) << uint32(0x0);           // 78 frostwolf hut a_a
                    data << uint32(0x530) << uint32(0x0);           // 79 stormpike first aid h_a
                    data << uint32(0x52f) << uint32(0x0);           // 80 stormpike first aid h_c
                    data << uint32(0x52d) << uint32(0x1);           // 81 stormpike first aid a_c
                }
                break;
            case 3277:                                          // Warsong Gulch
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_WS)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x62d) << uint32(0x0);       // 7 1581 alliance flag captures
                    data << uint32(0x62e) << uint32(0x0);       // 8 1582 horde flag captures
                    data << uint32(0x609) << uint32(0x0);       // 9 1545 unk, set to 1 on alliance flag pickup...
                    data << uint32(0x60a) << uint32(0x0);       // 10 1546 unk, set to 1 on horde flag pickup, after drop it's -1
                    data << uint32(0x60b) << uint32(0x2);       // 11 1547 unk
                    data << uint32(0x641) << uint32(0x3);       // 12 1601 unk (max flag captures?)
                    data << uint32(0x922) << uint32(0x1);       // 13 2338 horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
                    data << uint32(0x923) << uint32(0x1);       // 14 2339 alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
                }
                break;
            case 3358:                                          // Arathi Basin
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_AB)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x6e7) << uint32(0x0);       // 7 1767 stables alliance
                    data << uint32(0x6e8) << uint32(0x0);       // 8 1768 stables horde
                    data << uint32(0x6e9) << uint32(0x0);       // 9 1769 unk, ST?
                    data << uint32(0x6ea) << uint32(0x0);       // 10 1770 stables (show/hide)
                    data << uint32(0x6ec) << uint32(0x0);       // 11 1772 farm (0 - horde controlled, 1 - alliance controlled)
                    data << uint32(0x6ed) << uint32(0x0);       // 12 1773 farm (show/hide)
                    data << uint32(0x6ee) << uint32(0x0);       // 13 1774 farm color
                    data << uint32(0x6ef) << uint32(0x0);       // 14 1775 gold mine color, may be FM?
                    data << uint32(0x6f0) << uint32(0x0);       // 15 1776 alliance resources
                    data << uint32(0x6f1) << uint32(0x0);       // 16 1777 horde resources
                    data << uint32(0x6f2) << uint32(0x0);       // 17 1778 horde bases
                    data << uint32(0x6f3) << uint32(0x0);       // 18 1779 alliance bases
                    data << uint32(0x6f4) << uint32(0x7d0);     // 19 1780 max resources (2000)
                    data << uint32(0x6f6) << uint32(0x0);       // 20 1782 blacksmith color
                    data << uint32(0x6f7) << uint32(0x0);       // 21 1783 blacksmith (show/hide)
                    data << uint32(0x6f8) << uint32(0x0);       // 22 1784 unk, bs?
                    data << uint32(0x6f9) << uint32(0x0);       // 23 1785 unk, bs?
                    data << uint32(0x6fb) << uint32(0x0);       // 24 1787 gold mine (0 - horde contr, 1 - alliance contr)
                    data << uint32(0x6fc) << uint32(0x0);       // 25 1788 gold mine (0 - conflict, 1 - horde)
                    data << uint32(0x6fd) << uint32(0x0);       // 26 1789 gold mine (1 - show/0 - hide)
                    data << uint32(0x6fe) << uint32(0x0);       // 27 1790 gold mine color
                    data << uint32(0x700) << uint32(0x0);       // 28 1792 gold mine color, wtf?, may be LM?
                    data << uint32(0x701) << uint32(0x0);       // 29 1793 lumber mill color (0 - conflict, 1 - horde contr)
                    data << uint32(0x702) << uint32(0x0);       // 30 1794 lumber mill (show/hide)
                    data << uint32(0x703) << uint32(0x0);       // 31 1795 lumber mill color color
                    data << uint32(0x732) << uint32(0x1);       // 32 1842 stables (1 - uncontrolled)
                    data << uint32(0x733) << uint32(0x1);       // 33 1843 gold mine (1 - uncontrolled)
                    data << uint32(0x734) << uint32(0x1);       // 34 1844 lumber mill (1 - uncontrolled)
                    data << uint32(0x735) << uint32(0x1);       // 35 1845 farm (1 - uncontrolled)
                    data << uint32(0x736) << uint32(0x1);       // 36 1846 blacksmith (1 - uncontrolled)
                    data << uint32(0x745) << uint32(0x2);       // 37 1861 unk
                    data << uint32(0x7a3) << uint32(0x708);     // 38 1955 warning limit (1800)
                }
                break;
            case 3820:                                          // Eye of the Storm
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_EY)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0xac1) << uint32(0x0);       // 7  2753 Horde Bases
                    data << uint32(0xac0) << uint32(0x0);       // 8  2752 Alliance Bases
                    data << uint32(0xab6) << uint32(0x0);       // 9  2742 Mage Tower - Horde conflict
                    data << uint32(0xab5) << uint32(0x0);       // 10 2741 Mage Tower - Alliance conflict
                    data << uint32(0xab4) << uint32(0x0);       // 11 2740 Fel Reaver - Horde conflict
                    data << uint32(0xab3) << uint32(0x0);       // 12 2739 Fel Reaver - Alliance conflict
                    data << uint32(0xab2) << uint32(0x0);       // 13 2738 Draenei - Alliance conflict
                    data << uint32(0xab1) << uint32(0x0);       // 14 2737 Draenei - Horde conflict
                    data << uint32(0xab0) << uint32(0x0);       // 15 2736 unk // 0 at start
                    data << uint32(0xaaf) << uint32(0x0);       // 16 2735 unk // 0 at start
                    data << uint32(0xaad) << uint32(0x0);       // 17 2733 Draenei - Horde control
                    data << uint32(0xaac) << uint32(0x0);       // 18 2732 Draenei - Alliance control
                    data << uint32(0xaab) << uint32(0x1);       // 19 2731 Draenei uncontrolled (1 - yes, 0 - no)
                    data << uint32(0xaaa) << uint32(0x0);       // 20 2730 Mage Tower - Alliance control
                    data << uint32(0xaa9) << uint32(0x0);       // 21 2729 Mage Tower - Horde control
                    data << uint32(0xaa8) << uint32(0x1);       // 22 2728 Mage Tower uncontrolled (1 - yes, 0 - no)
                    data << uint32(0xaa7) << uint32(0x0);       // 23 2727 Fel Reaver - Horde control
                    data << uint32(0xaa6) << uint32(0x0);       // 24 2726 Fel Reaver - Alliance control
                    data << uint32(0xaa5) << uint32(0x1);       // 25 2725 Fel Reaver uncontrolled (1 - yes, 0 - no)
                    data << uint32(0xaa4) << uint32(0x0);       // 26 2724 Boold Elf - Horde control
                    data << uint32(0xaa3) << uint32(0x0);       // 27 2723 Boold Elf - Alliance control
                    data << uint32(0xaa2) << uint32(0x1);       // 28 2722 Boold Elf uncontrolled (1 - yes, 0 - no)
                    data << uint32(0xac5) << uint32(0x1);       // 29 2757 Flag (1 - show, 0 - hide) - doesn't work exactly this way!
                    data << uint32(0xad2) << uint32(0x1);       // 30 2770 Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag
                    data << uint32(0xad1) << uint32(0x1);       // 31 2769 Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag
                    data << uint32(0xabe) << uint32(0x0);       // 32 2750 Horde resources
                    data << uint32(0xabd) << uint32(0x0);       // 33 2749 Alliance resources
                    data << uint32(0xa05) << uint32(0x8e);      // 34 2565 unk, constant?
                    data << uint32(0xaa0) << uint32(0x0);       // 35 2720 Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0)
                    data << uint32(0xa9f) << uint32(0x0);       // 36 2719 Capturing progress-bar (0 - left, 100 - right)
                    data << uint32(0xa9e) << uint32(0x0);       // 37 2718 Capturing progress-bar (1 - show, 0 - hide)
                    data << uint32(0xc0d) << uint32(0x17b);     // 38 3085 unk
                    // and some more ... unknown
                }
                break;
            // any of these needs change! the client remembers the prev setting!
            // ON EVERY ZONE LEAVE, RESET THE OLD ZONE'S WORLD STATE, BUT AT LEAST THE UI STUFF!
            case 3483:                                          // Hellfire Peninsula
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_HP)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x9ba) << uint32(0x1);           // 10 // add ally tower main gui icon       // maybe should be sent only on login?
                    data << uint32(0x9b9) << uint32(0x1);           // 11 // add horde tower main gui icon      // maybe should be sent only on login?
                    data << uint32(0x9b5) << uint32(0x0);           // 12 // show neutral broken hill icon      // 2485
                    data << uint32(0x9b4) << uint32(0x1);           // 13 // show icon above broken hill        // 2484
                    data << uint32(0x9b3) << uint32(0x0);           // 14 // show ally broken hill icon         // 2483
                    data << uint32(0x9b2) << uint32(0x0);           // 15 // show neutral overlook icon         // 2482
                    data << uint32(0x9b1) << uint32(0x1);           // 16 // show the overlook arrow            // 2481
                    data << uint32(0x9b0) << uint32(0x0);           // 17 // show ally overlook icon            // 2480
                    data << uint32(0x9ae) << uint32(0x0);           // 18 // horde pvp objectives captured      // 2478
                    data << uint32(0x9ac) << uint32(0x0);           // 19 // ally pvp objectives captured       // 2476
                    data << uint32(2475)  << uint32(100); //: ally / horde slider grey area                              // show only in direct vicinity!
                    data << uint32(2474)  << uint32(50);  //: ally / horde slider percentage, 100 for ally, 0 for horde  // show only in direct vicinity!
                    data << uint32(2473)  << uint32(0);   //: ally / horde slider display                                // show only in direct vicinity!
                    data << uint32(0x9a8) << uint32(0x0);           // 20 // show the neutral stadium icon      // 2472
                    data << uint32(0x9a7) << uint32(0x0);           // 21 // show the ally stadium icon         // 2471
                    data << uint32(0x9a6) << uint32(0x1);           // 22 // show the horde stadium icon        // 2470
                }
                break;
            case 3518:                                          // Nagrand
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_NA)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    data << uint32(2503) << uint32(0x0);    // 10
                    data << uint32(2502) << uint32(0x0);    // 11
                    data << uint32(2493) << uint32(0x0);    // 12
                    data << uint32(2491) << uint32(0x0);    // 13
    
                    data << uint32(2495) << uint32(0x0);    // 14
                    data << uint32(2494) << uint32(0x0);    // 15
                    data << uint32(2497) << uint32(0x0);    // 16
    
                    data << uint32(2762) << uint32(0x0);    // 17
                    data << uint32(2662) << uint32(0x0);    // 18
                    data << uint32(2663) << uint32(0x0);    // 19
                    data << uint32(2664) << uint32(0x0);    // 20
    
                    data << uint32(2760) << uint32(0x0);    // 21
                    data << uint32(2670) << uint32(0x0);    // 22
                    data << uint32(2668) << uint32(0x0);    // 23
                    data << uint32(2669) << uint32(0x0);    // 24
    
                    data << uint32(2761) << uint32(0x0);    // 25
                    data << uint32(2667) << uint32(0x0);    // 26
                    data << uint32(2665) << uint32(0x0);    // 27
                    data << uint32(2666) << uint32(0x0);    // 28
    
                    data << uint32(2763) << uint32(0x0);    // 29
                    data << uint32(2659) << uint32(0x0);    // 30
                    data << uint32(2660) << uint32(0x0);    // 31
                    data << uint32(2661) << uint32(0x0);    // 32
    
                    data << uint32(2671) << uint32(0x0);    // 33
                    data << uint32(2676) << uint32(0x0);    // 34
                    data << uint32(2677) << uint32(0x0);    // 35
                    data << uint32(2672) << uint32(0x0);    // 36
                    data << uint32(2673) << uint32(0x0);    // 37
                }
                break;
            case 3519:                                          // Terokkar Forest
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_TF)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0xa41) << uint32(0x0);           // 10 // 2625 capture bar pos
                    data << uint32(0xa40) << uint32(0x14);          // 11 // 2624 capture bar neutral
                    data << uint32(0xa3f) << uint32(0x0);           // 12 // 2623 show capture bar
                    data << uint32(0xa3e) << uint32(0x0);           // 13 // 2622 horde towers controlled
                    data << uint32(0xa3d) << uint32(0x5);           // 14 // 2621 ally towers controlled
                    data << uint32(0xa3c) << uint32(0x0);           // 15 // 2620 show towers controlled
                    data << uint32(0xa88) << uint32(0x0);           // 16 // 2696 SE Neu
                    data << uint32(0xa87) << uint32(0x0);           // 17 // SE Horde
                    data << uint32(0xa86) << uint32(0x0);           // 18 // SE Ally
                    data << uint32(0xa85) << uint32(0x0);           // 19 //S Neu
                    data << uint32(0xa84) << uint32(0x0);           // 20 S Horde
                    data << uint32(0xa83) << uint32(0x0);           // 21 S Ally
                    data << uint32(0xa82) << uint32(0x0);           // 22 NE Neu
                    data << uint32(0xa81) << uint32(0x0);           // 23 NE Horde
                    data << uint32(0xa80) << uint32(0x0);           // 24 NE Ally
                    data << uint32(0xa7e) << uint32(0x0);           // 25 // 2686 N Neu
                    data << uint32(0xa7d) << uint32(0x0);           // 26 N Horde
                    data << uint32(0xa7c) << uint32(0x0);           // 27 N Ally
                    data << uint32(0xa7b) << uint32(0x0);           // 28 NW Ally
                    data << uint32(0xa7a) << uint32(0x0);           // 29 NW Horde
                    data << uint32(0xa79) << uint32(0x0);           // 30 NW Neutral
                    data << uint32(0x9d0) << uint32(0x5);           // 31 // 2512 locked time remaining seconds first digit
                    data << uint32(0x9ce) << uint32(0x0);           // 32 // 2510 locked time remaining seconds second digit
                    data << uint32(0x9cd) << uint32(0x0);           // 33 // 2509 locked time remaining minutes
                    data << uint32(0x9cc) << uint32(0x0);           // 34 // 2508 neutral locked time show
                    data << uint32(0xad0) << uint32(0x0);           // 35 // 2768 horde locked time show
                    data << uint32(0xacf) << uint32(0x1);           // 36 // 2767 ally locked time show
                }
                break;
            case 3521:                                          // Zangarmarsh
                if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_ZM)
                    pvp->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x9e1) << uint32(0x0);           // 10 //2529
                    data << uint32(0x9e0) << uint32(0x0);           // 11
                    data << uint32(0x9df) << uint32(0x0);           // 12
                    data << uint32(0xa5d) << uint32(0x1);           // 13 //2653
                    data << uint32(0xa5c) << uint32(0x0);           // 14 //2652 east beacon neutral
                    data << uint32(0xa5b) << uint32(0x1);           // 15 horde
                    data << uint32(0xa5a) << uint32(0x0);           // 16 ally
                    data << uint32(0xa59) << uint32(0x1);           // 17 // 2649 Twin spire graveyard horde  12???
                    data << uint32(0xa58) << uint32(0x0);           // 18 ally     14 ???
                    data << uint32(0xa57) << uint32(0x0);           // 19 neutral  7???
                    data << uint32(0xa56) << uint32(0x0);           // 20 // 2646 west beacon neutral
                    data << uint32(0xa55) << uint32(0x1);           // 21 horde
                    data << uint32(0xa54) << uint32(0x0);           // 22 ally
                    data << uint32(0x9e7) << uint32(0x0);           // 23 // 2535
                    data << uint32(0x9e6) << uint32(0x0);           // 24
                    data << uint32(0x9e5) << uint32(0x0);           // 25
                    data << uint32(0xa00) << uint32(0x0);           // 26 // 2560
                    data << uint32(0x9ff) << uint32(0x1);           // 27
                    data << uint32(0x9fe) << uint32(0x0);           // 28
                    data << uint32(0x9fd) << uint32(0x0);           // 29
                    data << uint32(0x9fc) << uint32(0x1);           // 30
                    data << uint32(0x9fb) << uint32(0x0);           // 31
                    data << uint32(0xa62) << uint32(0x0);           // 32 // 2658
                    data << uint32(0xa61) << uint32(0x1);           // 33
                    data << uint32(0xa60) << uint32(0x1);           // 34
                    data << uint32(0xa5f) << uint32(0x0);           // 35
                }
                break;
            case 3698:                                          // Nagrand Arena
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_NA)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0xa0f) << uint32(0x0);           // 7
                    data << uint32(0xa10) << uint32(0x0);           // 8
                    data << uint32(0xa11) << uint32(0x0);           // 9 show
                }
                break;
            case 3702:                                          // Blade's Edge Arena
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_BE)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0x9f0) << uint32(0x0);           // 7 gold
                    data << uint32(0x9f1) << uint32(0x0);           // 8 green
                    data << uint32(0x9f3) << uint32(0x0);           // 9 show
                }
                break;
            case 3968:                                          // Ruins of Lordaeron
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_RL)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0xbb8) << uint32(0x0);           // 7 gold
                    data << uint32(0xbb9) << uint32(0x0);           // 8 green
                    data << uint32(0xbba) << uint32(0x0);           // 9 show
                }
                break;
            case 4378:                                          // Dalaran Sewers
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_DS)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(3601) << uint32(0x0);           // 7 gold
                    data << uint32(3600) << uint32(0x0);           // 8 green
                    data << uint32(3610) << uint32(0x0);           // 9 show
                }
                break;
            case 3703:                                          // Shattrath City
            case 4384:                                          // Strand of the Ancients
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_SA)
                    bg->FillInitialWorldStates(data);
                else
                {
                    // 1-3 A defend, 4-6 H defend, 7-9 unk defend, 1 - ok, 2 - half destroyed, 3 - destroyed
                    data << uint32(0xf09) << uint32(0x0);       // 7  3849 Gate of Temple
                    data << uint32(0xe36) << uint32(0x0);       // 8  3638 Gate of Yellow Moon
                    data << uint32(0xe27) << uint32(0x0);       // 9  3623 Gate of Green Emerald
                    data << uint32(0xe24) << uint32(0x0);       // 10 3620 Gate of Blue Sapphire
                    data << uint32(0xe21) << uint32(0x0);       // 11 3617 Gate of Red Sun
                    data << uint32(0xe1e) << uint32(0x0);       // 12 3614 Gate of Purple Ametyst
    
                    data << uint32(0xdf3) << uint32(0x0);       // 13 3571 bonus timer (1 - on, 0 - off)
                    data << uint32(0xded) << uint32(0x0);       // 14 3565 Horde Attacker
                    data << uint32(0xdec) << uint32(0x0);       // 15 3564 Alliance Attacker
                    // End Round (timer), better explain this by example, eg. ends in 19:59 -> A:BC
                    data << uint32(0xde9) << uint32(0x0);       // 16 3561 C
                    data << uint32(0xde8) << uint32(0x0);       // 17 3560 B
                    data << uint32(0xde7) << uint32(0x0);      // 18 3559 A
                    data << uint32(0xe35) << uint32(0x0);       // 19 3637 East g - Horde control
                    data << uint32(0xe34) << uint32(0x0);       // 20 3636 West g - Horde control
                    data << uint32(0xe33) << uint32(0x0);       // 21 3635 South g - Horde control
                    data << uint32(0xe32) << uint32(0x0);       // 22 3634 East g - Alliance control
                    data << uint32(0xe31) << uint32(0x0);       // 23 3633 West g - Alliance control
                    data << uint32(0xe30) << uint32(0x0);       // 24 3632 South g - Alliance control
                    data << uint32(0xe2f) << uint32(0x0);       // 25 3631 Chamber of Ancients - Horde control
                    data << uint32(0xe2e) << uint32(0x0);       // 26 3630 Chamber of Ancients - Alliance control
                    data << uint32(0xe2d) << uint32(0x0);       // 27 3629 Beach1 - Horde control
                    data << uint32(0xe2c) << uint32(0x0);       // 28 3628 Beach2 - Horde control
                    data << uint32(0xe2b) << uint32(0x0);       // 29 3627 Beach1 - Alliance control
                    data << uint32(0xe2a) << uint32(0x0);       // 30 3626 Beach2 - Alliance control
                    // and many unks...
                }
                break;
            case 4406:                                          // Ring of Valor
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_RV)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(0xe10) << uint32(0x0);           // 7 gold
                    data << uint32(0xe11) << uint32(0x0);           // 8 green
                    data << uint32(0xe1a) << uint32(0x0);           // 9 show
                }
                break;
            case 4710:
                if (bg && bg->GetTypeID(true) == BATTLEGROUND_IC)
                    bg->FillInitialWorldStates(data);
                else
                {
                    data << uint32(4221) << uint32(1); // 7 BG_IC_ALLIANCE_RENFORT_SET
                    data << uint32(4222) << uint32(1); // 8 BG_IC_HORDE_RENFORT_SET
                    data << uint32(4226) << uint32(300); // 9 BG_IC_ALLIANCE_RENFORT
                    data << uint32(4227) << uint32(300); // 10 BG_IC_HORDE_RENFORT
                    data << uint32(4322) << uint32(1); // 11 BG_IC_GATE_FRONT_H_WS_OPEN
                    data << uint32(4321) << uint32(1); // 12 BG_IC_GATE_WEST_H_WS_OPEN
                    data << uint32(4320) << uint32(1); // 13 BG_IC_GATE_EAST_H_WS_OPEN
                    data << uint32(4323) << uint32(1); // 14 BG_IC_GATE_FRONT_A_WS_OPEN
                    data << uint32(4324) << uint32(1); // 15 BG_IC_GATE_WEST_A_WS_OPEN
                    data << uint32(4325) << uint32(1); // 16 BG_IC_GATE_EAST_A_WS_OPEN
                    data << uint32(4317) << uint32(1); // 17 unknown
    
                    data << uint32(4301) << uint32(1); // 18 BG_IC_DOCKS_UNCONTROLLED
                    data << uint32(4296) << uint32(1); // 19 BG_IC_HANGAR_UNCONTROLLED
                    data << uint32(4306) << uint32(1); // 20 BG_IC_QUARRY_UNCONTROLLED
                    data << uint32(4311) << uint32(1); // 21 BG_IC_REFINERY_UNCONTROLLED
                    data << uint32(4294) << uint32(1); // 22 BG_IC_WORKSHOP_UNCONTROLLED
                    data << uint32(4243) << uint32(1); // 23 unknown
                    data << uint32(4345) << uint32(1); // 24 unknown
                }
                break;
            // Icecrown Citadel
            case 4812:
                if (instance && mapid == 631)
                    instance->FillInitialWorldStates(data);
                else
                {
                    data << uint32(4903) << uint32(0);              // 9  WORLDSTATE_SHOW_TIMER (Blood Quickening weekly)
                    data << uint32(4904) << uint32(30);             // 10 WORLDSTATE_EXECUTION_TIME
                    data << uint32(4940) << uint32(0);              // 11 WORLDSTATE_SHOW_ATTEMPTS
                    data << uint32(4941) << uint32(50);             // 12 WORLDSTATE_ATTEMPTS_REMAINING
                    data << uint32(4942) << uint32(50);             // 13 WORLDSTATE_ATTEMPTS_MAX
                }
                break;
            // The Culling of Stratholme
            case 4100:
                if (instance && mapid == 595)
                    instance->FillInitialWorldStates(data);
                else
                {
                    data << uint32(3479) << uint32(0);              // 9  WORLDSTATE_SHOW_CRATES
                    data << uint32(3480) << uint32(0);              // 10 WORLDSTATE_CRATES_REVEALED
                    data << uint32(3504) << uint32(0);              // 11 WORLDSTATE_WAVE_COUNT
                    data << uint32(3931) << uint32(25);             // 12 WORLDSTATE_TIME_GUARDIAN
                    data << uint32(3932) << uint32(0);              // 13 WORLDSTATE_TIME_GUARDIAN_SHOW
                }
                break;
            default:
                data << uint32(0x914) << uint32(0x0);           // 7
                data << uint32(0x913) << uint32(0x0);           // 8
                data << uint32(0x912) << uint32(0x0);           // 9
                data << uint32(0x915) << uint32(0x0);           // 10
                break;
        }
        GetSession()->SendPacket(&data);
        SendBGWeekendWorldStates();
    }
    Last edited by stoneharry; 06-08-2011 at 05:25 AM. Reason: Added prefix because apparently you can't read the stickied thread saying the rules.

    Making Capturable PVP zones
  2. #2
    lxhackdxl's Avatar Banned
    Reputation
    34
    Join Date
    Oct 2008
    Posts
    471
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump. We are still looking for someone to help us with this.

    Please and thank you

  3. #3
    myran2's Avatar Contributor

    Reputation
    130
    Join Date
    Dec 2008
    Posts
    475
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those are packets being sent to the client.
    Each of the icons on the map that change when a zone is captured is stored in the client.

    Unless you'd like to tear open some dbc's and add some custom pvp-map icons yourself (I'm not sure if that's all you'd need to do, but that's where you should start) and then provide a mandatory patch to every single one of your users, you're kind of out of luck.

    The best way to do this without client modification would be "WSG-Style" where you send out a notification whenever a building is taken.

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by myran2 View Post
    The best way to do this without client modification would be "WSG-Style" where you send out a notification whenever a building is taken.
    You can use the POI system to display icons, buildings etc on the map... But I don't know if you can have more than one POI at a time. It is also possible to use worldstates to achieve something similar.

  5. #5
    myran2's Avatar Contributor

    Reputation
    130
    Join Date
    Dec 2008
    Posts
    475
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    You can use the POI system to display icons, buildings etc on the map... But I don't know if you can have more than one POI at a time. It is also possible to use worldstates to achieve something similar.
    That's what I get for speaking before thoroughly researching. :P
    Thanks for the info.

  6. #6
    lxhackdxl's Avatar Banned
    Reputation
    34
    Join Date
    Oct 2008
    Posts
    471
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well what we are basically trying to do is make "Sentinel Hill in Westfall" a capturable objective.. much like Halaa in nagrand.

    Working:
    Neutral flag (after server restart)
    Upon capture, guards spawn that are your faction (ie alliance or horde)

    Not working:
    Being able to recapture the POI on opposing faction.
    "Status Bar" indicating wich faction is taking the POI

  7. #7
    Spitfire103's Avatar Private
    Reputation
    7
    Join Date
    May 2011
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I MacGyver'd the C++ script to work using Halaa's base code. Wanted to upload a few pics in the meantime.





    Last edited by Spitfire103; 06-10-2011 at 04:09 PM.

  8. #8
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can get the clientside status bar working without a client patch, can't guess at the problem with re-capture but that's totally serverside so you should definitely be able to fix it.
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  9. #9
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by The-Eradicator View Post
    I don't think you can get the clientside status bar working without a client patch, can't guess at the problem with re-capture but that's totally serverside so you should definitely be able to fix it.
    It is, you just need to find the right worldstate.

    138 0 139 0 Progress: %2427w
    155 530 3521 0 Interface\WorldStateFrame\NeutralTower West Beacon

    These look like they could be them, but I can't say for sure without testing it.

    They come from the "worldstateui.dbc".

    Here's a small guide on how to manipulate wordstates:

    Code:
    World States
    Hello everyone, and welcome to my tutorial on World States.
    
    Contents
    What is a World State?
    Tools for the job.
    Getting started.
    Packets.
    Creating the tutorial example.
    Examples.
    Conclusion.
    
    
    
    
    What is a World State?
    You know when you go into a battleground and see that score counter at the top? That's a World State. World States are used in every battleground, and every time you see something displayed at the top of your screen; that's a World State. World States can sometimes also be invisible until you move within range of a certain object (Think the towers in EOTS).
    Whilst it's not needed, I strongly recommend you read Hypersniper's tutorial on Packet Editing. World States are configured this way. I'd also recommend you have a strong knowledge of Lua before attempting to understand this, lest you get caught up in the multiple lines of code. 
    
    
    
    
    Tools for the job.
    To start, you'll need a few tools.
    You'll need a spreadsheet program, or something that can view CSV files. I strongly recommend, and use, OpenOffice. It's free and very nicely presented.
    You may also want Notepad++.
    You will also need the CSV file of WorldStateUI.dbc. You can get this by using a DBC to CSV converter, or use the one I've conviently extracted already.
    
    
    
    
    Getting started.
    Once you've downloaded OpenOffice (have you not got it already), you'll need to open the CSV file you extracted/downloaded with OpenOffice Calc. You'll be presented with a screen like this:
    http://i40.tinypic.com/vxkf39.jpg
    
    Just hit OK and then you'll see this:
    http://i39.tinypic.com/2dkde9h.jpg
    
    This all looks confusing, but don't worry, we're only looking for a few bits of specific information;
    Code:
    	Column B - MapID
    	Column C - ZoneID
    	Column D - Phase
    	Column F - Text
    		We'll get onto this later.
    	Column AN - WorldState ID
    Despite the MapID and ZoneID fields, the client does not have to be in the specified zone or map to view the WorldState. This is because we will be sending the Packet to specific clients later on.
    
    
    
    
    Packets.
    The information we have is all good and well, but we need to send a packet to get it to the client. For this, we need to use two SMSGs; INIT_WORLD_STATES and UPDATE_WORLD_STATE.
    SMSG_INIT_WORLD_STATES is used to set the INITIAL World State values. This needs to be used each time you're creating a new World State.
    It's usually 18 bytes per packet.
    Structure
    Code:
    	uint32 MapID (Must match WorldStateUI.dbc)
    	uint32 ZoneID (Must match WorldStateUI.dbc)
    	uint32 0
    	uint16 1
    	uint32 WorldStateID
    	uint32 Value (Must match WorldStateUI.dbc)
    SMSG_UPDATE_WORLD_STATE
    It's usually 8 bytes per packet.
    Structure
    Code:
    	uint32 WorldStateID (Must match WorldStateUI.dbc)
    	uint32 Value
    Now I'll tell you about Column F. Here's an example; 
    Code:
    Bases: %1779w  Resources: %1776w/%1780w
    Now, what do those numbers mean, I hear you ask? Those're WorldStateIDs. This is what the server (and client) uses to determine what to display.
    If I wanted to show 'Bases: 1 Resources: 2000/2000', then I'd have to send 3 packets, one for each World State. 
    
    Let's create our first packet to show this thing, shall we?
    Code:
    -- Init world state general example.
    local pack = LuaPacket:CreatePacket(706, 18); -- 706 = SMSG_INIT_WORLD_STATES
    pack:WriteULong(MapID); -- WriteULong is a uint32 value.
    pack:WriteULong(ZoneID);
    pack:WriteULong(0);
    pack:WriteUShort(1); -- WriteUShort is a uint16 value.
    pack:WriteULong(WorldStateID);
    pack:WriteULong(Value);
    MethodToSendPacket(pack);
    
    -- Update world state example.
    local pack = LuaPacket:CreatePacket(707, 8); -- 707 = SMSG_UPDATE_WORLD_STATE
    pack:WriteULong(WorldStateID);
    pack:WriteULong(Value);
    MethodToSendPacket(pack);
    This of course won't do anything, but that's the basic layout of your World State Packets.
    
    
    
    
    Creating the tutorial example.
    We're going to create this example:
    http://i44.tinypic.com/sp999t.jpg
    
    To do this, we will need to create two init state packets and six update state packets and then send them to the zone / player. For this tutorial, I'll be sending to the zone, since that is more likely to be used than a single player.
    First off, we'll create our Base count init packet for the Alliance.
    We'll need to find the Map, Zone, Phase and WorldState IDs to use. The Alliance info is found on row 40 of the CSV file, the Horde counterpart being 41.
    Code:
    	Row 40:
    		Map: 529
    		Zone: 0
    		Phase: 0
    		Text: Bases: %1779w  Resources: %1776w/%1780w
    		WorldState IDs: 0, 1779, 1776, 1780
    		
    	Row 41:
    		Map: 529
    		Zone: 0
    		Phase: 0
    		Text: Bases: %1778w  Resources: %1777w/%1780w
    		WorldState IDs: 0, 1778, 1777, 1780
    The first WorldStateID is the one you use in the Init Packet, found in field AN40/41. The other three are the ones for the text file.
    
    With that said, let's create our init packets. 
    Code:
    function CreatePackets()
    	local Packet = LuaPacket:CreatePacket(706, 18);
    	-- Packet
    	Packet:WriteULong(529); -- our MapID from row 40
    	Packet:WriteULong(0); -- our ZoneID from row 40
    	Packet:WriteULong(0); -- our Phase. 0 sets it to ALL phases, iirc.
    	Packet:WriteUShort(1);
    	Packet:WriteULong(0); -- our Base WorldState ID from row 40.
    	Packet:WriteULong(0); -- It's best to give it no value and set it later in an update packet.
    	SendPacket(Packet);
    end
    This will create all the init packets you need. Then, you just need to send them. You could use a custom function, such as this one:
    Code:
    function SendPacket(packet, ...)
    	local type, id = ...;
    	if (type == "ZONE") then
    		for _, v in pairs(GetPlayersInZone(id)) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == "WORLD") then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == nil) then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	end
    end
    Which would be called like SendPacket(packet[, type, id]), where type and id are optional arguments. This would send the specified packet to the ZONE or WORLD, or WORLD if type & id aren't specified.
    So, if we're using the above two functions, to send our init packets, we would add this at the end of our code:
    Code:
    function SendPacket(packet, ...)
    	local type, id = ...;
    	if (type == "ZONE") then
    		for _, v in pairs(GetPlayersInZone(id)) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == "WORLD") then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == nil) then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	end
    end
    
    function CreatePackets()
    	local Packet = LuaPacket:CreatePacket(706, 18);
    	-- Packet
    	Packet:WriteULong(529); -- our MapID from row 40
    	Packet:WriteULong(0); -- our ZoneID from row 40
    	Packet:WriteULong(0); -- our Phase. 0 sets it to ALL phases, iirc.
    	Packet:WriteUShort(1);
    	Packet:WriteULong(0); -- our Base WorldState ID from row 40.
    	Packet:WriteULong(0); -- It's best to give it no value and set it later in an update packet.
     SendPacket(Packet);
    end
    This would automatically send all packets after they've been created.
    Now we've created the init packets, we need to create the update packets. We can do this, again, using a custom function:
    Code:
    function CreateUpdatePacket(state, value)
    	local pack = LuaPacket:CreatePacket(707, 8);
    	pack:WriteULong(state);
    	pack:WriteULong(value);
    	return pack;
    end
    This will create the packet for us, which we can then just plug into SendPacket() and it'll send it for us.
    Our code so far is this: 
    
    Code:
    function SendPacket(packet, ...)
    	local type, id = ...;
    	if (type == "ZONE") then
    		for _, v in pairs(GetPlayersInZone(id)) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == "WORLD") then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	elseif (type == nil) then
    		for _, v in pairs(GetPlayersInWorld()) do
    			v:SendPacketToPlayer(packet);
    		end
    	end
    end
    
    function CreateUpdatePacket(state, value)
    	local pack = LuaPacket:CreatePacket(707, 8);
    	pack:WriteULong(state);
    	pack:WriteULong(value);
    	return pack;
    end
    
    function CreatePackets()
    	local Packet = LuaPacket:CreatePacket(706, 18);
    	-- Packet
    	Packet:WriteULong(529); -- our MapID from row 40
    	Packet:WriteULong(0); -- our ZoneID from row 40
    	Packet:WriteULong(0); -- our Phase. 0 sets it to ALL phases, iirc.
    	Packet:WriteUShort(1);
    	Packet:WriteULong(0); -- our Base WorldState ID from row 40.
    	Packet:WriteULong(0); -- It's best to give it no value and set it later in an update packet.
    	SendPacket(Packet);
    end
    
    SendPacket(CreateUpdatePacket(1776, 740));
    SendPacket(CreateUpdatePacket(1777, 1500));
    SendPacket(CreateUpdatePacket(1778, 1));
    SendPacket(CreateUpdatePacket(1779, 4));
    SendPacket(CreateUpdatePacket(1780, 2000));
    This is the end of the code, really. What this does:
    Creates the init packets, all six of them, and then sends them all to world.
    It them updates the packets so that they show updated values.
    The result?
    
    http://i44.tinypic.com/sp999t.jpg
    Code:
    Examples
    
    Violet Hold seal integrity & portals opened count.
    To use it, you call CreatePackets(unit:GetInstanceId()); or something similar when the instance is entered.
    When a portal is opened, you can use SendPacketToInstance(PortalOpened(portalnumber), unit:GetInstanceId());
    And, when the door is damaged (Prison Seal Integrity damage), you can use SendPacketToInstance(IntegrityDamage(percentage), unit:GetInstanceId()); Where percentage is the amount of durability of the door left.
    Code:
    function CreatePackets(instanceid)
    	-- Portals Opened: %3810w/18
    	-- Prison Seal Integrity: %3815w%
    	local VHPacket_prisonSeal = LuaPacket:CreatePacket(706, 18);
    	local VHPacket_portalsOpened = LuaPacket:CreatePacket(706, 18);
    	-- VHPacket_prisonSeal
    	VHPacket_prisonSeal:WriteULong(608);
    	VHPacket_prisonSeal:WriteULong(0);
    	VHPacket_prisonSeal:WriteULong(0);
    	VHPacket_prisonSeal:WriteUShort(1);
    	VHPacket_prisonSeal:WriteULong(3816);
    	VHPacket_prisonSeal:WriteULong(1); -- 100%
    	-- VHPacket_portalsOpened
    	VHPacket_portalsOpened:WriteULong(608);
    	VHPacket_portalsOpened:WriteULong(4415);
    	VHPacket_portalsOpened:WriteULong(0);
    	VHPacket_portalsOpened:WriteUShort(1);
    	VHPacket_portalsOpened:WriteULong(3816);
    	VHPacket_portalsOpened:WriteULong(1); -- 0/18
    	SendPacketToInstance(VHPacket, 4415, instanceid);
    	PrisonIntegrity(100);
    	PortalsOpened(0);
    end
    	
    function SendPacketToInstance(packet, ...)
    	local id, instanceid = ...;
    	for _, v in pairs(GetPlayersInZone(id)) do
    		if (v:GetInstanceId() == instanceid) then
    			v:SendPacketToPlayer(packet);
    		end
    	end
    end
    
    function PrisonIntegrity(percentage)
    	local pack = LuaPacket:CreatePacket(707, 8);
    	pack:WriteULong(3815);
    	pack:WriteULong(percentage);
    	return pack;
    end
    
    function PortalOpened(value)
    	local pack = LuaPacket:CreatePacket(707, 8);
    	pack:WriteULong(3810);
    	pack:WriteULong(value);
    	return pack;
    end
    FAQ
    Question: Help! My display isn't showing up!
    Make sure that you've specified the right number of WriteULongs. If there is no phase (or 0) specified in column D, then you use the following packet:
    Code:
    	local packet = LuaPacket:CreatePacket(7067, 18);
    	packet:WriteULong(map);
    	packet:WriteULong(zone);
    	packet:WriteULong(0);
    	packet:WriteULong(1);
    	packet:WriteULong(state);
    	packet:WriteULong(value);
    Otherwise, you use this one:
    Code:
    	local packet = LuaPacket:CreatePacket(7067, 18);
    	packet:WriteULong(map);
    	packet:WriteULong(zone);
    	packet:WriteULong(phase);
    	packet:WriteULong(0);
    	packet:WriteULong(1);
    	packet:WriteULong(state);
    	packet:WriteULong(value);
    
    
    Conclusion
    I hope my tutorial helps you in many ways. Packets are very versatile, and WorldStates can set the boundary for new BGs to be created. If you have any questions, do not hesistate to post them below, PM me, or add me to MSN at [email protected].
    
    
    Thanks to Hypersniper for providing the packet structure.
    
    Neglected.
    That is to do it in Lua, but it is the same way in C++ to construct and send the packets.

    Also:

    Code:
    					(*itr)->SendWorldStateUpdate(WORLDSTATE_HELLFIRE_PVP_CAPTURE_BAR_DISPLAY, 1);
    					(*itr)->SendWorldStateUpdate(WORLDSTATE_HELLFIRE_PVP_CAPTURE_BAR_VALUE, Status);
    Just need to find where that's defined and manipulate it I guess.

    I could be wrong - but you should be able to customise this without a client edit.
    Last edited by stoneharry; 06-10-2011 at 04:44 PM.

Similar Threads

  1. Replies: 38
    Last Post: 08-01-2010, 03:49 PM
  2. [Guide] How to make imba pvp rogue=)
    By DarkneZZimba in forum World of Warcraft Guides
    Replies: 21
    Last Post: 05-19-2008, 06:06 AM
  3. [Guide] Making a leveling zone on your private server.
    By Hiddennoremac in forum World of Warcraft Guides
    Replies: 6
    Last Post: 05-14-2008, 03:37 PM
  4. [Guide] How to make an PvP Intro (Sony Vegas)
    By [ Prototype ] in forum World of Warcraft Guides
    Replies: 15
    Last Post: 11-16-2007, 12:03 AM
  5. How to make a PVP intro like Fony
    By Valmilu in forum World of Warcraft Guides
    Replies: 4
    Last Post: 03-28-2007, 11:18 AM
All times are GMT -5. The time now is 04:48 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search