Jump to content

[TC 3.3.5][SOLVED]Custom Gobject Command "not existed"

By Roarl
in Serverside

Recommended Posts

Hi there!

I added a command in cs_gobject.cpp, called "deletelast", which thus is a subcommand of "gobject".

So, I added a ChatCommand in gobjectCommandTable :

{ "deletelast", rbac::RBAC_PERM_COMMAD_GOBJECT_DELETELAST, false, &HandleGameObjectDeleteLastCommand, ""   },

And the Handle is :

static bool HandleGameObjectDeleteLastCommand(ChatHandler* handler, char const* args)
	{		
		GameObject* object = NULL;

		// by DB guid
		Player* player = handler->GetSession()->GetPlayer();
		Map* map = player->GetMap();
		ObjectGuid::LowType guidLow = map->GenerateLowGuid<HighGuid::GameObject>() - 1;

		if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
			object = handler->GetObjectGlobalyWithGuidOrNearWithDbGuid(guidLow, gameObjectData->id);

		if (!object)
		{
			handler->PSendSysMessage(LANG_COMMAND_OBJNOTFOUND, guidLow);
			handler->SetSentErrorMessage(true);
			return false;
		}

		ObjectGuid ownerGuid = object->GetOwnerGUID();
		if (ownerGuid)
		{
			Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid);
			if (!owner || !ownerGuid.IsPlayer())
			{
				handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), object->GetGUID().GetCounter());
				handler->SetSentErrorMessage(true);
				return false;
			}

			owner->RemoveGameObject(object, false);
		}

		object->SetRespawnTime(0);                                 // not save respawn time
		object->Delete();
		object->DeleteFromDB();

		handler->PSendSysMessage(LANG_COMMAND_DELOBJMESSAGE, object->GetGUID().GetCounter());

		return true;
	}

I did create a permission in RBAC.h :

RBAC_PERM_COMMAD_GOBJECT_DELETELAST                      = 1000,

and I did create rows in auth's tables rbac_permissions and rbac_linked_permissions as well as in world's table commands.

USE auth 
INSERT INTO `rbac_linked_permissions` VALUES (193, 1000); 
INSERT INTO `rbac_permissions` VALUES (1000, 'Command: gobject deletelast'); 
USE world
INSERT INTO `command` VALUES ('gobject deletelast', 1000, 'Syntax: .gobject deletelast\r\nDelete last gobject in DB.');

 

Now, I have no problem with scripting the command itself. My problem is rather that the command doesn't even want to trigger.
When I type ".gobject deletelast" in-game, TrinityCore World Server Daemon says : "Table 'command' have not existed subcommand 'deletelast' in command 'gobject deletelast', skip." .

Would anyone know about what I did wrong here? 

Thanks in advance for your patience. :)

 

Edited by Roarl
Link to comment
Share on other sites

Erm... solved.

But before I tell how please promise you won't chop my head off...

SOOOoooo... I built in Debug and was running the Release... =3 =3

(thanks anyway Kaev! / anyone who read this )

Edited by Roarl
Link to comment
Share on other sites

This are the small mistakes that we all do. :P

I once made a support request at the TrinityCore forum and was pretty sure that i added my script to the ScriptLoader.
In the end i forgot to add it to the ScriptLoader and looked like a idiot.. :P

Link to comment
Share on other sites

  • 2 years later...

Update 1 (21/09/2018)

- Added Icons for all Items

- replaced Horde PVP twohanded Sword

- Many PVE Weapons/Shields added (replaced ingame Weapons/Shields)

- patch Database updated

- download link in the primary post is updated

Pls report Bugs, such as missing textures ore else. As you see in the Database, like class quest item preparations, I am not at the end with this patch. More Updates will follow as time permits. wishes are welcome too ;) 

PVP WEAPONS
18828/High Warlord's Cleaver = 161679/dread-gladiators-cleaver
18831/High Warlord's Battle Axe = 161690/dread-gladiators-decapitator
18833/grand-marshals-bullseye = 161680/dread-gladiators-longbow
BLP18835/High Warlord's Recurve = 161702/dread-gladiators-longbow
23456/Grand Marshal's Swiftblade = 161708/dread-gladiators-slicer
12584/Grand Mashal's Longsword = 161708/dread-gladiators-slicer
23467/High Warlord's Quickblade = 161687/dread-gladiators-slicer
16345/High Warlord's Blade = 161687/dread-gladiators-slicer
18876/Grand Marshal's Claymore = 161692/dread-gladiators-greatsword
18860/high-warlords-street-sweeper = 161691/dread-gladiators-rifle
18855/grand-marshals-hand-cannon = 161701/dread-gladiators-rifle
23466/high-warlords-spellblade = 161707/dread-gladiators-spellblade
18840/high-warlords-razor = 162016/dread-gladiators-shanker
23451/grand-marshals-mageblade = 161681/dread-gladiators-spellblade
18838/grand-marshals-dirk = 161681/dread-gladiators-spellblade
23465/high-warlords-destroyer = 161684/dread-gladiators-bonegrinder
18868/high-warlords-pulverizer = 161684/dread-gladiators-bonegrinder
23455/grand-marshals-demolisher = 161703/dread-gladiators-bonegrinder
18867/grand-marshals-battle-hammer = 161703/dread-gladiators-bonegrinder
18871/high-warlords-pig-sticker = 161685/dread-gladiators-pike
18869/grand-marshals-glaive = 161700/dread-gladiators-pike
23464/high-warlords-battle-mace = 161706/dread-gladiators-gavel
18866/high-warlords-bludgeon = 161706/dread-gladiators-gavel
23454/grand-marshals-warhammer = 161683/dread-gladiators-gavel
18865/grand-marshals-punisher = 161683/dread-gladiators-gavel
18874/high-warlords-war-staff = 161686/dread-gladiators-staff
18873/grand-marshals-stave = 161699/dread-gladiators-staff
18877/high-warlords-greatsword = 128908/warswords-of-the-valarjar (red)
18830/grand-marshals-sunderer = 155055/soul-curse-executioner
PVP SHIELDS
18825/Grand Marshal's Aegis = 161698/dread-gladiators-barrier
18826/High Warlord's Shield Wall = 161677/dread-gladiators-barrier
PVE WEAPONS
34609/quickening-blade-of-the-prince = unknownID/sword_1h_turalyon_d_01
50210/seethe = 128820/felomelorn
45516/voldrethar-dark-blade-of-oblivion = 152094/taeshalach
45233/stormrune-edge = 160686/voror-gleaming-blade-of-the-stalwart (blue)
45868/aesirs-edge = 160686/voror-gleaming-blade-of-the-stalwart (purple)
46016/abaddon = 160686/voror-gleaming-blade-of-the-stalwart (yellow)
49888/shadows-edge = 50840/frostmourne-broken
49623/shadowmourne = 49706/frostmourne
PVE SHIELDS
51909/neverending-winter = 51909/neverending-winter (orange, custom)
40701/crygils-discarded-plate-panel = 91558/malevolent-gladiators-redoubt
47448/bastion-of-resolve (red) = 161695/dread-gladiators-shield-wall (red)
47287/bastion-of-resolve (red) = 161695/dread-gladiators-shield-wall (red)
48040/pride-of-the-korkron (green) = 161695/dread-gladiators-shield-wall (green)
47895/pride-of-the-korkron (green) = 161695/dread-gladiators-shield-wall (green)
47421/forlorn-barrier (blue) = 161677/dread-gladiators-barrier
 (black)
47260/forlorn-barrier (blue) = 161677/dread-gladiators-barrier
 (black)
48055/aegis-of-the-coliseum (red) = 161677/dread-gladiators-barrier
 (red)
47910/aegis-of-the-coliseum (red) = 161677/dread-gladiators-barrier
 (red)
47085/bastion-of-purity (blue) = 161698/dread-gladiators-barrier (gold)
47079/bastion-of-purity (blue) = 161698/dread-gladiators-barrier (gold)
47963/vigilant-ward (green) = 161698/dread-gladiators-barrier (silver)
47812/vigilant-ward (green) = 161698/dread-gladiators-barrier (silver)
46964/crystal-plated-vanguard (yellow) = 161697/dread-gladiators-shield-wall (gold)
46963/crystal-plated-vanguard (yellow) = 161697/dread-gladiators-shield-wall (gold)
47978/bulwark-of-the-royal-guard (blue) = 161697/dread-gladiators-shield-wall (silver)
47835/bulwark-of-the-royal-guard (blue) = 161697/dread-gladiators-shield-wall (silver)
40475/barricade-of-eternity = 139165/bloodseekers-bulwark
CLASS QUESTS DEATHKNIGHT
CLASS QUESTS DRUID
CLASS QUESTS HUNTER
CLASS QUESTS MAGE
CLASS QUESTS PALADIN
CLASS QUESTS PRIEST
CLASS QUESTS ROGUE
CLASS QUESTS SHAMAN
CLASS QUESTS WARLOCK
15109/staff-of-soranruk = 128941/scepter-of-sargeras (6-yellow)
CLASS QUESTS WARRIOR
7120/rugas-bulwark (H) = 128289/scale-of-the-earth-warder
6970/furens-favor (A) = 128289/scale-of-the-earth-warder
 
 

 

Link to comment
Share on other sites

Update 1 (21/09/2018)

- Added Icons for all Items

- replaced Horde PVP twohanded Sword

- Many PVE Weapons/Shields added (replaced ingame Weapons/Shields)

- patch Database updated

- download link in the primary post is updated

Pls report Bugs, such as missing textures ore else. As you see in the Database, like class quest item preparations, I am not at the end with this patch. More Updates will follow as time permits. wishes are welcome too ;) 

PVP WEAPONS
18828/High Warlord's Cleaver = 161679/dread-gladiators-cleaver
18831/High Warlord's Battle Axe = 161690/dread-gladiators-decapitator
18833/grand-marshals-bullseye = 161680/dread-gladiators-longbow
BLP18835/High Warlord's Recurve = 161702/dread-gladiators-longbow
23456/Grand Marshal's Swiftblade = 161708/dread-gladiators-slicer
12584/Grand Mashal's Longsword = 161708/dread-gladiators-slicer
23467/High Warlord's Quickblade = 161687/dread-gladiators-slicer
16345/High Warlord's Blade = 161687/dread-gladiators-slicer
18876/Grand Marshal's Claymore = 161692/dread-gladiators-greatsword
18860/high-warlords-street-sweeper = 161691/dread-gladiators-rifle
18855/grand-marshals-hand-cannon = 161701/dread-gladiators-rifle
23466/high-warlords-spellblade = 161707/dread-gladiators-spellblade
18840/high-warlords-razor = 162016/dread-gladiators-shanker
23451/grand-marshals-mageblade = 161681/dread-gladiators-spellblade
18838/grand-marshals-dirk = 161681/dread-gladiators-spellblade
23465/high-warlords-destroyer = 161684/dread-gladiators-bonegrinder
18868/high-warlords-pulverizer = 161684/dread-gladiators-bonegrinder
23455/grand-marshals-demolisher = 161703/dread-gladiators-bonegrinder
18867/grand-marshals-battle-hammer = 161703/dread-gladiators-bonegrinder
18871/high-warlords-pig-sticker = 161685/dread-gladiators-pike
18869/grand-marshals-glaive = 161700/dread-gladiators-pike
23464/high-warlords-battle-mace = 161706/dread-gladiators-gavel
18866/high-warlords-bludgeon = 161706/dread-gladiators-gavel
23454/grand-marshals-warhammer = 161683/dread-gladiators-gavel
18865/grand-marshals-punisher = 161683/dread-gladiators-gavel
18874/high-warlords-war-staff = 161686/dread-gladiators-staff
18873/grand-marshals-stave = 161699/dread-gladiators-staff
18877/high-warlords-greatsword = 128908/warswords-of-the-valarjar (red)
18830/grand-marshals-sunderer = 155055/soul-curse-executioner
PVP SHIELDS
18825/Grand Marshal's Aegis = 161698/dread-gladiators-barrier
18826/High Warlord's Shield Wall = 161677/dread-gladiators-barrier
PVE WEAPONS
34609/quickening-blade-of-the-prince = unknownID/sword_1h_turalyon_d_01
50210/seethe = 128820/felomelorn
45516/voldrethar-dark-blade-of-oblivion = 152094/taeshalach
45233/stormrune-edge = 160686/voror-gleaming-blade-of-the-stalwart (blue)
45868/aesirs-edge = 160686/voror-gleaming-blade-of-the-stalwart (purple)
46016/abaddon = 160686/voror-gleaming-blade-of-the-stalwart (yellow)
49888/shadows-edge = 50840/frostmourne-broken
49623/shadowmourne = 49706/frostmourne
PVE SHIELDS
51909/neverending-winter = 51909/neverending-winter (orange, custom)
40701/crygils-discarded-plate-panel = 91558/malevolent-gladiators-redoubt
47448/bastion-of-resolve (red) = 161695/dread-gladiators-shield-wall (red)
47287/bastion-of-resolve (red) = 161695/dread-gladiators-shield-wall (red)
48040/pride-of-the-korkron (green) = 161695/dread-gladiators-shield-wall (green)
47895/pride-of-the-korkron (green) = 161695/dread-gladiators-shield-wall (green)
47421/forlorn-barrier (blue) = 161677/dread-gladiators-barrier
 (black)
47260/forlorn-barrier (blue) = 161677/dread-gladiators-barrier
 (black)
48055/aegis-of-the-coliseum (red) = 161677/dread-gladiators-barrier
 (red)
47910/aegis-of-the-coliseum (red) = 161677/dread-gladiators-barrier
 (red)
47085/bastion-of-purity (blue) = 161698/dread-gladiators-barrier (gold)
47079/bastion-of-purity (blue) = 161698/dread-gladiators-barrier (gold)
47963/vigilant-ward (green) = 161698/dread-gladiators-barrier (silver)
47812/vigilant-ward (green) = 161698/dread-gladiators-barrier (silver)
46964/crystal-plated-vanguard (yellow) = 161697/dread-gladiators-shield-wall (gold)
46963/crystal-plated-vanguard (yellow) = 161697/dread-gladiators-shield-wall (gold)
47978/bulwark-of-the-royal-guard (blue) = 161697/dread-gladiators-shield-wall (silver)
47835/bulwark-of-the-royal-guard (blue) = 161697/dread-gladiators-shield-wall (silver)
40475/barricade-of-eternity = 139165/bloodseekers-bulwark
CLASS QUESTS DEATHKNIGHT
CLASS QUESTS DRUID
CLASS QUESTS HUNTER
CLASS QUESTS MAGE
CLASS QUESTS PALADIN
CLASS QUESTS PRIEST
CLASS QUESTS ROGUE
CLASS QUESTS SHAMAN
CLASS QUESTS WARLOCK
15109/staff-of-soranruk = 128941/scepter-of-sargeras (6-yellow)
CLASS QUESTS WARRIOR
7120/rugas-bulwark (H) = 128289/scale-of-the-earth-warder
6970/furens-favor (A) = 128289/scale-of-the-earth-warder
 
 

 

Link to comment
Share on other sites

×
×
  • Create New...