Jump to content

[Help] Custom Commands?/.home


Recommended Posts

  • 41 years later...

hi.

now my question is how to make custom commands?

example of what i want to do is ...

when ordinary player [GM level 0] enters .home

to be teleported to the stormwind [alliance] or orgrimmar [Horde] i know there is somtehing with c++ editing and scripting but what exactly? i find in the mangos source in game/Chat commands/ and than Level0-3? what i have to do with that?

i use Rev. 10615

DB: YTDB 0.13.9

Basic knowledge of C + + available!

if someone can help i'd appreciate.

Greetz and thanks Hugo

Link to comment
Share on other sites

See how the command itself is implemented, then find a way to duplicate part of the implementation (or modify it).

.tele -> Level1.cpp -> ChatHandler::HandleTeleCommand -> extractGameTeleFromLink -> Chat.cpp -> return objmgr.GetGameTele() -> ObjectMgr.cpp -> ObjectMgr::GetGameTele -> ...

or did I miss something?

i want to made an .home command wehre alliance go to stormwind and horde go to orgrimmar. i copy the tele command from Level1 to level0 and add replace all tele with home (wrong? right?) now i want to tell mangos when race not an alli race then get x y z orgrimmar location when alliance race than teleport to stormwind location... can anyone please help me what i have to change more?

Link to comment
Share on other sites

You have to add a command in chat.cpp static ChatCommand commandTable[] first. In your command code, you can try use a switch case to determine player race. I think there is many example on how to determine player race inside mangos source code, you can look at it first.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use