Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] I am having an issue with a SmartScript. My SmartScript works when the event_flags is set to 0, but

[DiscordArchive] I am having an issue with a SmartScript. My SmartScript works when the event_flags is set to 0, but

[DiscordArchive] I am having an issue with a SmartScript. My SmartScript works when the event_flags is set to 0, but

Pages (3): 1 2 3 Next
rektbyfaith
Administrator
0
08-26-2022, 06:48 PM
#1
Archived author: 郑佩茹 • Posted: 2022-08-26T18:48:47.848000+00:00
Original source

I am having an issue with a SmartScript. My SmartScript works when the event_flags is set to 0, but when I set it to 6 (only fire in difficulty 0 and 1,) it no longer works in any difficulty. I added a log to the code to check, and it passes the bitmask check condition in SmartScript::FillScript correctly when in difficulties 0 and 1 but not 2, as expected, but even after adding to mEvents vector it does not fire. Does anyone know why this might be happen?
rektbyfaith
08-26-2022, 06:48 PM #1

Archived author: 郑佩茹 • Posted: 2022-08-26T18:48:47.848000+00:00
Original source

I am having an issue with a SmartScript. My SmartScript works when the event_flags is set to 0, but when I set it to 6 (only fire in difficulty 0 and 1,) it no longer works in any difficulty. I added a log to the code to check, and it passes the bitmask check condition in SmartScript::FillScript correctly when in difficulties 0 and 1 but not 2, as expected, but even after adding to mEvents vector it does not fire. Does anyone know why this might be happen?

rektbyfaith
Administrator
0
08-26-2022, 06:49 PM
#2
Archived author: 郑佩茹 • Posted: 2022-08-26T18:49:47.218000+00:00
Original source

Here is the relevant function:
```
void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger const* at)
{
(void)at; // ensure that the variable is referenced even if extra logs are disabled in order to pass compiler checks

if (e.empty())
{
if (obj)
LOG_DEBUG("sql.sql", "SmartScript: EventMap for Entry {} is empty but is using SmartScript.", obj->GetEntry());

if (at)
LOG_DEBUG("sql.sql", "SmartScript: EventMap for AreaTrigger {} is empty but is using SmartScript.", at->entry);
return;
}
for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i)
{
#ifndef ACORE_DEBUG
if ((*i).event.event_flags & SMART_EVENT_FLAG_DEBUG_ONLY)
continue;
#endif

if ((*i).event.event_flags & SMART_EVENT_FLAG_DIFFICULTY_ALL)//if has instance flag add only if in it
{
if (obj && obj->GetMap()->IsDungeon())
{
LOG_ERROR("", "Spawn Mode {}, Event Flags {}, Shifted Value {}", obj->GetMap()->GetSpawnMode(), (*i).event.event_flags, (1 << (obj->GetMap()->GetSpawnMode() + 1)));
if ((1 << (obj->GetMap()->GetSpawnMode() + 1)) & (*i).event.event_flags)
{
LOG_ERROR("", "Fired event!"); // This is working and this log is appearing, but the action does not happen!
mEvents.push_back((*i));
}
}
continue;
}
mEvents.push_back((*i));//NOTE: 'world(0)' events still get processed in ANY instance mode
}
}
```
rektbyfaith
08-26-2022, 06:49 PM #2

Archived author: 郑佩茹 • Posted: 2022-08-26T18:49:47.218000+00:00
Original source

Here is the relevant function:
```
void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger const* at)
{
(void)at; // ensure that the variable is referenced even if extra logs are disabled in order to pass compiler checks

if (e.empty())
{
if (obj)
LOG_DEBUG("sql.sql", "SmartScript: EventMap for Entry {} is empty but is using SmartScript.", obj->GetEntry());

if (at)
LOG_DEBUG("sql.sql", "SmartScript: EventMap for AreaTrigger {} is empty but is using SmartScript.", at->entry);
return;
}
for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i)
{
#ifndef ACORE_DEBUG
if ((*i).event.event_flags & SMART_EVENT_FLAG_DEBUG_ONLY)
continue;
#endif

if ((*i).event.event_flags & SMART_EVENT_FLAG_DIFFICULTY_ALL)//if has instance flag add only if in it
{
if (obj && obj->GetMap()->IsDungeon())
{
LOG_ERROR("", "Spawn Mode {}, Event Flags {}, Shifted Value {}", obj->GetMap()->GetSpawnMode(), (*i).event.event_flags, (1 << (obj->GetMap()->GetSpawnMode() + 1)));
if ((1 << (obj->GetMap()->GetSpawnMode() + 1)) & (*i).event.event_flags)
{
LOG_ERROR("", "Fired event!"); // This is working and this log is appearing, but the action does not happen!
mEvents.push_back((*i));
}
}
continue;
}
mEvents.push_back((*i));//NOTE: 'world(0)' events still get processed in ANY instance mode
}
}
```

rektbyfaith
Administrator
0
08-26-2022, 06:53 PM
#3
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:53:41.129000+00:00
Original source

k it looks like it just goes down the list nicely, warrior is 1, paladin is 10, hunter 100, rogue 1000 so on
rektbyfaith
08-26-2022, 06:53 PM #3

Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:53:41.129000+00:00
Original source

k it looks like it just goes down the list nicely, warrior is 1, paladin is 10, hunter 100, rogue 1000 so on

rektbyfaith
Administrator
0
08-26-2022, 06:54 PM
#4
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:54:08.498000+00:00
Original source

so 0001101101 should get me all my classes
rektbyfaith
08-26-2022, 06:54 PM #4

Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:54:08.498000+00:00
Original source

so 0001101101 should get me all my classes

rektbyfaith
Administrator
0
08-26-2022, 06:56 PM
#5
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:56:16.323000+00:00
Original source

cache :/
rektbyfaith
08-26-2022, 06:56 PM #5

Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:56:16.323000+00:00
Original source

cache :/

rektbyfaith
Administrator
0
08-26-2022, 06:56 PM
#6
Archived author: eldwarvo0001 • Posted: 2022-08-26T18:56:55.236000+00:00
Original source

But, what's the use? Agility doesnt do anything for casters
rektbyfaith
08-26-2022, 06:56 PM #6

Archived author: eldwarvo0001 • Posted: 2022-08-26T18:56:55.236000+00:00
Original source

But, what's the use? Agility doesnt do anything for casters

rektbyfaith
Administrator
0
08-26-2022, 06:57 PM
#7
Archived author: eldwarvo0001 • Posted: 2022-08-26T18:57:22.208000+00:00
Original source

It's fun though
rektbyfaith
08-26-2022, 06:57 PM #7

Archived author: eldwarvo0001 • Posted: 2022-08-26T18:57:22.208000+00:00
Original source

It's fun though

rektbyfaith
Administrator
0
08-26-2022, 06:57 PM
#8
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:57:32.574000+00:00
Original source

i wasnt giving it to casters
rektbyfaith
08-26-2022, 06:57 PM #8

Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:57:32.574000+00:00
Original source

i wasnt giving it to casters

rektbyfaith
Administrator
0
08-26-2022, 06:57 PM
#9
Archived author: eldwarvo0001 • Posted: 2022-08-26T18:57:45.578000+00:00
Original source

rektbyfaith
08-26-2022, 06:57 PM #9

Archived author: eldwarvo0001 • Posted: 2022-08-26T18:57:45.578000+00:00
Original source

rektbyfaith
Administrator
0
08-26-2022, 06:58 PM
#10
Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:58:00.493000+00:00
Original source

and it does lots for casters, like when they are silenced
rektbyfaith
08-26-2022, 06:58 PM #10

Archived author: Ĝ̷̳r̸̹͊a̷̜̚k̴̞̔ • Posted: 2022-08-26T18:58:00.493000+00:00
Original source

and it does lots for casters, like when they are silenced

Pages (3): 1 2 3 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)