World Chat Command

Hello, i am new in this thing of scripting c++, well i am trying to make a script of World chat command like .chat bla bla bla, i have taken much of scripts that are done on this web and much others and they don’t work alltimes when i script it gives me some error like LNKxxx and such things, i have read about this and it’s because the script its not updated so i tryied to write one meself and same still hapenin, here is the script: http://pastebin.com/1KESxqCM

well this one compiled fine but when i try to use the command .chat it says me does not exist or don’t have access and when i try whit player acct it don’t do nothing just say .chat text so it don’t work.

Also i am using VS 2012 to compile and last rev of Cmake, i have no errors while compiling whitout custom scripts it works all fine i setup the sv and it works.

— Canned message start —

This thread is not related to the official Trinity codebase and was moved to the Custom Code section.

Please read the stickies next time.

— Canned message end —

Sorry for posting in wrong section, it seems i pressed on wrong tab, anyway i just compiled whit other script and still getting this damn error : http://i60.tinypic.com/15wdjd2.png it was whit this one http://pastebin.com/hikeD5T3 any idea? i have last rev pulled from TC git

You used wrong function name in scriptloader.cpp

Use [COLOR=rgb(0,0,0)]AddSC_cs_world_chat

See line 132 on http://pastebin.com/hikeD5T3

The first script you posted needs rbac changes.

Thanks for the reply, i have solved it as you said. Now i am trying to create a Teleporter Stone whit gossip menu but it seems be not easy, and also want to ask if its possible to create a ‘‘item upgrader stone’’ like right click on it then on item and quest is shown whit the mats required for next and better item.

You need item gossip for that:

http://rochet2.github.io/?page=Player_and_Item_Gossip

The upgrade quest thing should be easy. You just add a quest to the item.

http://collab.kpsn.org/display/tc/Item+template+tc2#Itemtemplatetc2-startquest

http://collab.kpsn.org/display/tc/Quest+template+tc2

See existing items that give quests.

Okay, i go here, i must make script whit itemgossipexample the player one and the last one is a patch, and i have a question is here any way to apply patch to core whitout git? cause i can’t install it on me pc, and about the upgrader whit quests i mean only 1 item that u right click it then left click on any ‘‘upgradeable item’’ and dat says u what u need for upgrade and things, if its the same way sorry me dumb but i am so new on this c++ thing.

Edit:

I have write this http://pastebin.com/mA2DGp4N it gives me 50 errors T_T, also 1 question more how to bind the script to the item ingame.

okay fixed dat errors it was the commas and 0 left at last coords, now it gives me : Warning 2 warning C4305: ‘argument’ : truncation from ‘double’ to ‘float’ C:Eluna-TC-Wotlk-mastersrcserverscriptsCustomtele_stone.cpp 36 1 scripts

You can for example just manually do the changes in the file.
Just look at where to add and what from the patch.

You use the scriptname to bind it to the item. ItemScript(“tele_stone”) ← that string there

see item_template. Also note that on use hook requires the item to have a spell on use. Like hearthstone etc.

Could you show the errors?..

The upgrade item can be difficult if you want it like that, since you will need the item to use a spell that can select another item, for example disenchanting or something similar.

Then you would need to script that to do what you need when the spell is used. The spell could be just on use on the upgrade item.

The truncation error is a warning.

And its there since double is bigger than float.

Teleport function accepts float as arguments for coords.

You can notify that a value is float by adding f after it:

double value = 1.0;

float value = 1.0f;

Fine thx for reply i go try make the upgrader meself, anyway i have solved all errors from the tele stone script it compile whitout errors now, and to bind it if i understand it, i must go in db item_template and add in scriptname tele_stone? and its gonna be binded, i go try to bind it to hearthstone to see if it works.

And whit the patch, for example

— a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
[COLOR=rgb(128,0,128)]@@ -100,6 +100,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recvData)
if (_player->PlayerTalkClass->IsGossipOptionCoded(gossipListId))
recvData >> code;

to make it manually i must go to src/server/game/handlers/mischandler.cpp and edit that line to this one Î?

Edit: also here is the fixed script for stone: http://pastebin.com/mA2DGp4N

Yeah…

Okay thx for all, helped me alot.

Okay i havea nother problem now, the item works it show the main menu Ally and Horde cities but when i click them nothing happens, no submenu for cities teleport, any idea? http://pastebin.com/mA2DGp4N

did you add the patch I mentioned?

I have applied manually the patch since whit git apply was telling me patch does not apply, but the submenus still don’t show. I must make ExamplePlayerGossip same as ExampleItemGossip? whit the same functions i mean, because i only have created the stone_tele from ExampleItemGossip.