Forum > Serverside Modding
[SOLVED] [C++] Set PvP FFA when player enter map
<< < (4/5) > >>
schlumpf:
Please try that override thing. It can probably help a lot.
bizzlesnaff:
--- Quote from: "schlumpf" ---Please try that override thing. It can probably help a lot. --- End quote ---
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..:(
bizzlesnaff:
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
Rochet2:
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: ---#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(); } --- End code ---
bizzlesnaff:
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!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
|