This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED] [C++] Set PvP FFA when player enter map  (Read 11314 times)

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [C++] Set PvP FFA when player enter map
« Reply #15 on: July 06, 2015, 04:27:40 pm »
Please try that override thing. It can probably help a lot.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

bizzlesnaff

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 124
    • View Profile
Re: [C++] Set PvP FFA when player enter map
« Reply #16 on: July 06, 2015, 04:39:40 pm »
Quote from: "schlumpf"
Please try that override thing. It can probably help a lot.

ah...forget it last time ;(

But now the flag changed when I leave buildings, or enter them...that's not possible...the map have no vmap or mmap..

edit:
with "override" nothing changed...I also lost the ffa flag when I leave a zone, instead I get pvp flaged..:(
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

bizzlesnaff

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 124
    • View Profile
Re: [C++] Set PvP FFA when player enter map
« Reply #17 on: July 07, 2015, 08:28:08 pm »
little...push ;(?

I've tried it now with an dbc solution, but my map have the area flag 0, and I can't change this. And anytime player enter now any building (house etc.) they get ffa flaged..

[attachment=0:1s00pqfm]WoWScrnShot_070715_202711.jpg[/attachment:1s00pqfm]


edit:

I don't know why, but at any point of my map I've the zone and area Id 0, but if i move on the map the area names  appears..thats so..strange
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rochet2

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
    • http://rochet2.github.io/
Re: [C++] Set PvP FFA when player enter map
« Reply #18 on: July 09, 2015, 12:11:03 pm »
As said on TC forums, this works for me on non custom maps.
Hmm .. I guess the naming of the event and such could be changed though ..

Code: [Select]
#include "ScriptPCH.h"

class Teleport : public BasicEvent
{
public:
    Teleport(Player* player) : _player(player)
    {
        player->m_Events.AddEvent(this, player->m_Events.CalculateTime(0));
    }

    bool Execute(uint64 /*time*/, uint32 /*diff*/)
    {
        printf("TIME EVENTn");
        _player->pvpInfo.IsInFFAPvPArea = true;
        _player->UpdatePvPState(true);
        return true;
    }

    Player* _player;
};

class OnMapEnter : public PlayerScript
{
public:
    OnMapEnter() : PlayerScript("OnMapEnter") { }

    void OnUpdateZone(Player* player, uint32 /*newZone*/, uint32 /*newArea*/) override
    {
        if (player->GetMapId() == 1)
        {
            printf("UPDATE ZONE!n");
            new Teleport(player);
        }
    }

    void OnMapChanged(Player * player) override
    {
        if (player->GetMapId() == 1)
        {
            printf("UPDATE MAP!n");
            new Teleport(player);
        }
    }
};

void AddSC_OnMapEnter()
{
    new OnMapEnter();
}
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

bizzlesnaff

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 124
    • View Profile
Re: [C++] Set PvP FFA when player enter map
« Reply #19 on: July 09, 2015, 03:18:31 pm »
Well..First THANK YOU! :D This is the first script, which change anything constantly :D

To answer your question from TC forum. DBC editing ist not possible, because my custom map is just a copy of outland, and I don't like to change the "reald" outlands ;)
So..the strange thing is, with your script I'm ffa flaged..except in orgrimmar, stormwind etc. :D
But thats no problem..try it now on my map..:)

edit:
worked awesome on my custom map! (well..shattrath...is...yeah..still sanctury..but thats no problem)

Thank you very much rochet!
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rochet2

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
    • http://rochet2.github.io/
Re: [C++] Set PvP FFA when player enter map
« Reply #20 on: July 09, 2015, 03:31:43 pm »
Quote from: "bizzlesnaff"
So..the strange thing is, with your script I'm ffa flaged..except in orgrimmar, stormwind etc. :D

Its not so strange because that is how the FFA code works by default as well.
On FFA pvp realms the cities are not  FFA PVP either. And the stuff there is using the existing system.

.. I think.

If you want to disable the sanctuary stuff etc as well, setting the info to the pvpinfo should be enough before calling the update I think...
« Last Edit: January 01, 1970, 01:00:00 am by Admin »