Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] hmm still doesn't work, how can I check if OnUpdate is called?

[DiscordArchive] hmm still doesn't work, how can I check if OnUpdate is called?

[DiscordArchive] hmm still doesn't work, how can I check if OnUpdate is called?

Pages (4): Previous 1 2 3 4
rektbyfaith
Administrator
0
01-19-2020, 09:17 PM
#31
Archived author: -- • Posted: 2020-01-19T21:17:37.444000+00:00
Original source

we didn't add them to db2
rektbyfaith
01-19-2020, 09:17 PM #31

Archived author: -- • Posted: 2020-01-19T21:17:37.444000+00:00
Original source

we didn't add them to db2

rektbyfaith
Administrator
0
01-19-2020, 09:18 PM
#32
Archived author: Auhgarn • Posted: 2020-01-19T21:18:34.622000+00:00
Original source

> ```cpp
> #include "GameObject.h"
> #include "Player.h"
> #include "ScriptMgr.h"
>
> class atal_dazar_entrance : public GameObjectScript
> {
> public:
> uint16 timer;
> atal_dazar_entrance() : GameObjectScript("atal_dazar_entrance")
> {
> timer = 5000;
> }
>
> void OnUpdate(GameObject* obj, uint32 diff) override
> {
> if (timer <= diff)
> {
> if (Player* player = obj->SelectNearestPlayer(5.0f))
> {
> player->TeleportTo(1763, -848.41f, 2060.18f, 725.14f, 0, 0);
> }
> }
> else
> {
> timer -= diff;
> }
> }
> };
>
> void AddSC_zuldazar()
> {
> new atal_dazar_entrance();
> }
> ```
<@!177134386263752705>
I thought this was the script that could be added to the gameobject
rektbyfaith
01-19-2020, 09:18 PM #32

Archived author: Auhgarn • Posted: 2020-01-19T21:18:34.622000+00:00
Original source

> ```cpp
> #include "GameObject.h"
> #include "Player.h"
> #include "ScriptMgr.h"
>
> class atal_dazar_entrance : public GameObjectScript
> {
> public:
> uint16 timer;
> atal_dazar_entrance() : GameObjectScript("atal_dazar_entrance")
> {
> timer = 5000;
> }
>
> void OnUpdate(GameObject* obj, uint32 diff) override
> {
> if (timer <= diff)
> {
> if (Player* player = obj->SelectNearestPlayer(5.0f))
> {
> player->TeleportTo(1763, -848.41f, 2060.18f, 725.14f, 0, 0);
> }
> }
> else
> {
> timer -= diff;
> }
> }
> };
>
> void AddSC_zuldazar()
> {
> new atal_dazar_entrance();
> }
> ```
<@!177134386263752705>
I thought this was the script that could be added to the gameobject

rektbyfaith
Administrator
0
01-19-2020, 09:19 PM
#33
Archived author: Auhgarn • Posted: 2020-01-19T21:19:27.755000+00:00
Original source

I will give it a try with playerlist
rektbyfaith
01-19-2020, 09:19 PM #33

Archived author: Auhgarn • Posted: 2020-01-19T21:19:27.755000+00:00
Original source

I will give it a try with playerlist

rektbyfaith
Administrator
0
01-19-2020, 09:19 PM
#34
Archived author: Auhgarn • Posted: 2020-01-19T21:19:30.180000+00:00
Original source

like you said
rektbyfaith
01-19-2020, 09:19 PM #34

Archived author: Auhgarn • Posted: 2020-01-19T21:19:30.180000+00:00
Original source

like you said

rektbyfaith
Administrator
0
01-19-2020, 09:19 PM
#35
Archived author: -- • Posted: 2020-01-19T21:19:30.546000+00:00
Original source

`struct go_ataldazar_entrance : public GameObjectAI
{
go_ataldazar_entrance(GameObject* go) : GameObjectAI(go) { checkTimer = 2000; }

void UpdateAI(uint32 diff) override
{
if (checkTimer <= diff)
{
std::list<Player*> players;
go->GetPlayerListInGrid(players, 5.f);

for (Player* player : players)
player->TeleportTo(1763, -848.41f, 2060.18f, 725.14f, 0, 0);
}
else
checkTimer -= diff;
}

private:
uint32 checkTimer;
};`
rektbyfaith
01-19-2020, 09:19 PM #35

Archived author: -- • Posted: 2020-01-19T21:19:30.546000+00:00
Original source

`struct go_ataldazar_entrance : public GameObjectAI
{
go_ataldazar_entrance(GameObject* go) : GameObjectAI(go) { checkTimer = 2000; }

void UpdateAI(uint32 diff) override
{
if (checkTimer <= diff)
{
std::list<Player*> players;
go->GetPlayerListInGrid(players, 5.f);

for (Player* player : players)
player->TeleportTo(1763, -848.41f, 2060.18f, 725.14f, 0, 0);
}
else
checkTimer -= diff;
}

private:
uint32 checkTimer;
};`

rektbyfaith
Administrator
0
01-19-2020, 09:19 PM
#36
Archived author: -- • Posted: 2020-01-19T21:19:47.206000+00:00
Original source

RegisterGameObjectAI(go_ataldazar_entrance );
rektbyfaith
01-19-2020, 09:19 PM #36

Archived author: -- • Posted: 2020-01-19T21:19:47.206000+00:00
Original source

RegisterGameObjectAI(go_ataldazar_entrance );

rektbyfaith
Administrator
0
01-19-2020, 09:31 PM
#37
Archived author: Auhgarn • Posted: 2020-01-19T21:31:47.428000+00:00
Original source

Can't get it to work, but will sit more with it tomorrow
rektbyfaith
01-19-2020, 09:31 PM #37

Archived author: Auhgarn • Posted: 2020-01-19T21:31:47.428000+00:00
Original source

Can't get it to work, but will sit more with it tomorrow

Pages (4): Previous 1 2 3 4
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)