Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item/Misc: Implement Toy Train Set and Wind-Up Train Wrecker #16218

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

Treeston
Copy link
Member

@Treeston Treeston commented Jan 9, 2016

Item/Misc: Implement Toy Train Set and Wind-Up Train Wrecker.

TODO:

  • Remove Toy Train aura when leaving range
  • Remove Toy Train aura when train destroyed

Can't think of pretty ways of doing these. Suggestions appreciated.

Also, WorldPacket hack is ugly, but needed to get sound.

@ghost
Copy link

ghost commented Jan 9, 2016

creature text also supports emotes (type 16)
As far as I know as long as there is a whisper guid the text will be only visible to the targeted player

@Treeston
Copy link
Member Author

Treeston commented Jan 9, 2016

@Northstrider creature_text emotes do not have sound. They only use ->HandleEmoteCommand, which plays the anim without sound.

@ghost
Copy link

ghost commented Jan 9, 2016

Do you have used sniff datas to find about the event? Many sounds are triggered by spells. If this is not the case the Talk function should be adapted to play sounds as well if defined.

if(!_isChasing)
if (GameObject* target = me->FindNearestGameObject(GO_TOY_TRAIN, 40.0f))
Wreck(target);
_searchTimer = 3 * IN_MILLISECONDS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 ms is quite low. An update cycle takes way longer than that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's 3 seconds. IN_MILLISECONDS = 1000

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. My bad.

P.S When can we start using http://en.cppreference.com/w/cpp/chrono/operator%22%22ms? Pretty please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As soon as TC stops supporting ancient compilers and requires MSVC 2015

dummyPacket << target->GetGUID();

if (WorldSession* session = target->GetSession())
session->HandleTextEmoteOpcode(dummyPacket);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing this crap instead of just sending SMSG_TEXT_EMOTE? Also sniff it, maybe it doesn't even use this opcode

@ccrs
Copy link
Member

ccrs commented Jan 10, 2016

logic seems solid, so the only ToDo is the aura, right?
Can you paste the id pls?

@Treeston
Copy link
Member Author

Aura is SPELL_TOY_TRAIN_PULSE = 61551,

@ccrs
Copy link
Member

ccrs commented Jan 10, 2016

well, if sniffs dont show any other spell involving the unaura, I guess the best option is to make an aurascript which stores caster on apply and search its status on each update call.
If nothing is found, remove itself from the targets.

edit: nvm there is no script call for nonperiodic auras on update

last option is to make creature/gameobject remove it on nearby players :P

edit2: last last option, create a playerAI just as I did on raise ally hahaha

@@ -338,6 +341,10 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityQualityStore, dbcPath, "DurabilityQuality.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesStore, dbcPath, "Emotes.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextStore, dbcPath, "EmotesText.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextSoundStore, dbcPath, "EmotesTextSound.dbc");
for (uint32 i = 0; i < sEmotesTextSoundStore.GetNumRows(); ++i)
if(EmotesTextSoundEntry const* entry = sEmotesTextSoundStore.LookupEntry(i))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codestyle, space between if and (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants