• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Trinity C++] Tools NPC

Synth

Exalted Member
Hello Emudevs,today i'm sharing a script maded by Mthsena called "Tools NPC".
Script info:
●Restore HP and MP
●Reset Instances
●Reset Cooldowns
●Reset Combat
● Remove Sickness
●Repair Items
●Reset Talents
●Reset Spells

SQL NPC:
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES('900000','0','0','0','0','0','26867','0','0','0','Tools NPC','Emudevs','Speak','0','80','80','0','35','35','1','1','1.14286','2','3','0','0','0','0','1','0','0','1','0','0','0','0','0','0','0','0','0','0','0','0','4','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','3','1','1','1','1','0','0','0','0','0','0','0','0','1','0','0','Tools_NPC','1');


If you find any bug feel free to ask me !
Thank you :)
Best regards,
Synth !
 

darksoke

OnTop500
just wonder if "Mthsena" know you are sharing his scripts :D :)) just saing probably he would want to join this comunity and share them by himself :D
 

Tommy

Founder
just wonder if "Mthsena" know you are sharing his scripts :D :)) just saing probably he would want to join this comunity and share them by himself :D

He's only sharing, doesn't hurt anyone. Also, are you sure Mthsena actually coded it? :p
 

darksoke

OnTop500
He's only sharing, doesn't hurt anyone. Also, are you sure Mthsena actually coded it? :p

just sayn :S "Hello Emudevs,today i'm sharing a script maded by Mthsena called "Tools NPC"." anyway almost all scripts are from trinitycore forums they are just updated and posted on emu forums :|
 

Tommy

Founder
just sayn :S "Hello Emudevs,today i'm sharing a script maded by Mthsena called "Tools NPC"." anyway almost all scripts are from trinitycore forums they are just updated and posted on emu forums :|

And a lot of scripts are shared on WoW Emu forums before they reach TrinityCore's forum. Just bypass where they are from, he gave credits and contributed by sharing, that's all what matters here.

Please feel free to re-read through the Rules..
 

darksoke

OnTop500
And a lot of scripts are shared on WoW Emu forums before they reach TrinityCore's forum. Just bypass where they are from, he gave credits and contributed by sharing, that's all what matters here.

Please feel free to re-read through the Rules..

probably i broke a bit the rule 7 but just sayn most devs left emu forums to join trinitycore forum and they also released theyr content to trinitycore :| and that's it i will stop this subject started to be ridiculous //
 

Synth

Exalted Member
Ya like Tommy,said i'm just sharing and give credits so what you need more? Darksoke ?
 

Tok124

Respected Member
Hello Emudevs,today i'm sharing a script maded by Mthsena called "Tools NPC".
Script info:
●Restore HP and MP
●Reset Instances
●Reset Cooldowns
●Reset Combat
● Remove Sickness
●Repair Items
●Reset Talents
●Reset Spells

SQL NPC:


Script:
Tools NPC - C++ - Pastebin

If you find any bug feel free to ask me !
Thank you :)
Best regards,
Synth !
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: revision.h, Configuration: Release Win32 ------
3>------ Build started: Project: game, Configuration: Release Win32 ------
4>------ Build started: Project: scripts, Configuration: Release Win32 ------
3> ScriptLoader.cpp
4> toolsnpc.cpp
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(40): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(64): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
3> game.vcxproj -> F:\Build\src\server\game\Release\game.lib
5>------ Build started: Project: worldserver, Configuration: Release Win32 ------
5>game.lib(ScriptLoader.obj) : error LNK2019: unresolved external symbol "void __cdecl AddSC_Tools_NPC(void)" (?AddSC_Tools_NPC@@YAXXZ) referenced in function "void __cdecl AddCustomScripts(void)" (?AddCustomScripts@@YAXXZ)
5>F:\Build\bin\Release\worldserver.exe : fatal error LNK1120: 1 unresolved externals
6>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
6> Build all projects
========== Build: 4 succeeded, 2 failed, 16 up-to-date, 0 skipped ==========
 

Hyperion

Founder
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: revision.h, Configuration: Release Win32 ------
3>------ Build started: Project: game, Configuration: Release Win32 ------
4>------ Build started: Project: scripts, Configuration: Release Win32 ------
3> ScriptLoader.cpp
4> toolsnpc.cpp
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(40): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(64): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
3> game.vcxproj -> F:\Build\src\server\game\Release\game.lib
5>------ Build started: Project: worldserver, Configuration: Release Win32 ------
5>game.lib(ScriptLoader.obj) : error LNK2019: unresolved external symbol "void __cdecl AddSC_Tools_NPC(void)" (?AddSC_Tools_NPC@@YAXXZ) referenced in function "void __cdecl AddCustomScripts(void)" (?AddCustomScripts@@YAXXZ)
5>F:\Build\bin\Release\worldserver.exe : fatal error LNK1120: 1 unresolved externals
6>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
6> Build all projects
========== Build: 4 succeeded, 2 failed, 16 up-to-date, 0 skipped ==========

Did you add the script to your ScriptLoader?
 

Tommy

Founder
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: revision.h, Configuration: Release Win32 ------
3>------ Build started: Project: game, Configuration: Release Win32 ------
4>------ Build started: Project: scripts, Configuration: Release Win32 ------
3> ScriptLoader.cpp
4> toolsnpc.cpp
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(40): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
4>..\..\..\..\Trinity\src\server\scripts\Custom\toolsnpc.cpp(64): error C2664: 'void WorldObject::MonsterWhisper(int32,const Player *,bool)' : cannot convert argument 2 from 'uint64' to 'const Player *'
4> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
3> game.vcxproj -> F:\Build\src\server\game\Release\game.lib
5>------ Build started: Project: worldserver, Configuration: Release Win32 ------
5>game.lib(ScriptLoader.obj) : error LNK2019: unresolved external symbol "void __cdecl AddSC_Tools_NPC(void)" (?AddSC_Tools_NPC@@YAXXZ) referenced in function "void __cdecl AddCustomScripts(void)" (?AddCustomScripts@@YAXXZ)
5>F:\Build\bin\Release\worldserver.exe : fatal error LNK1120: 1 unresolved externals
6>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
6> Build all projects
========== Build: 4 succeeded, 2 failed, 16 up-to-date, 0 skipped ==========

MonsterWhisper arguments are as followed:

MonsterWhisper(const char* text, Player const* target, bool IsBossWhisper = false);
MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper = false);

MonsterWhisper
MonsterSay
MonsterYell

And practically all of the chat functions were changed awhile ago by TC.
 

Optimus

Emulation Addict
Hey gentlemans,
is it possible for you to update this cool script for: TrinityCore rev. 431da2ffc984+ 2016-03-05 01:26:26 +0000 (3.3.5 branch) (Unix, Release) - TDB 335.60.

It will be so good if you can do that for me and the community.

Thanks in advance!
 

Lstm

Respected Member
Hey gentlemans,
is it possible for you to update this cool script for: TrinityCore rev. 431da2ffc984+ 2016-03-05 01:26:26 +0000 (3.3.5 branch) (Unix, Release) - TDB 335.60.

It will be so good if you can do that for me and the community.

Thanks in advance!



Try using this edition I made ..
I'm new in the area but I am willing to share my experiences :)




Code:
#include "Player.h"
#include "Define.h"
#include "Creature.h"
#include "ScriptMgr.h"
#include "WorldSession.h"
#include "ScriptedGossip.h"
 
class Tools_NPC : public CreatureScript
{
public:
        Tools_NPC() : CreatureScript("Tools_NPC") { }
 
        bool OnGossipHello(Player *player, Creature *creature)
        {
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Restore HP and MP", GOSSIP_SENDER_MAIN, 1);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Instances", GOSSIP_SENDER_MAIN, 2);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Cooldowns", GOSSIP_SENDER_MAIN, 3);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Combat", GOSSIP_SENDER_MAIN, 4);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Remove Sickness", GOSSIP_SENDER_MAIN, 5);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Repair Items", GOSSIP_SENDER_MAIN, 6);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Others", GOSSIP_SENDER_MAIN, 7);
                player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Nevermind", GOSSIP_SENDER_MAIN, 8);
                player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
                return true;
        }
        bool OnGossipSelect(Player *player, Creature *creature, uint32 sender, uint32 action)
        {
                player->PlayerTalkClass->ClearMenus();
                switch(action)
                {
                case 1: // Restore HP and MP
                        if(player->IsInCombat())
                        {
                            player->GetSession()->SendNotification("Você está em combate!");
							player->PlayerTalkClass->SendCloseGossip();
                                return false;
                        }
                        else if(player->getPowerType() == POWER_MANA)
                                player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA));
 
							player->SetHealth(player->GetMaxHealth());
							player->CLOSE_GOSSIP_MENU();
                        break;
                case 2: // Reset Instances
                        for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
                        {
                                Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
                                for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
                                {
                                        player->UnbindInstance(itr, Difficulty(i));
                                }
                        }
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 3: // Reset Cooldowns
                        if(player->IsInCombat())
                        {
                            player->GetSession()->SendNotification("Você está em combate!");
							player->PlayerTalkClass->SendCloseGossip();
                                return false;
                        }
 
						player->GetSpellHistory()->ResetAllCooldowns();
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 4: // Reset Combat
                        player->CombatStop();
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 5: // Remove Sickness
                        if(player->HasAura(15007))
                                player->RemoveAura(15007);
 
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 6: // Repair Items
                        player->DurabilityRepairAll(false, 0, false);
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 7: // Others
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Talents", GOSSIP_SENDER_MAIN, 71);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Spells", GOSSIP_SENDER_MAIN, 72);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "<-Back", GOSSIP_SENDER_MAIN, 73);
                        player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
                        break;
                case 8:
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 71: // Reset Talents
                        player->ResetTalents(true);
                        player->SendTalentsInfoData(false);
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 72: // Reset Spells
                        player->ResetSpells();
                        player->CLOSE_GOSSIP_MENU();
                        break;
                case 73: // ...Back
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Restore HP and MP", GOSSIP_SENDER_MAIN, 1);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Instances", GOSSIP_SENDER_MAIN, 2);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Cooldowns", GOSSIP_SENDER_MAIN, 3);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Reset Combat", GOSSIP_SENDER_MAIN, 4);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Remove Sickness", GOSSIP_SENDER_MAIN, 5);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Repair Items", GOSSIP_SENDER_MAIN, 6);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "Others", GOSSIP_SENDER_MAIN, 7);
                        player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Nevermind", GOSSIP_SENDER_MAIN, 8);
                        player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
                        break;
                }
                return true;
        }
};
 
void AddSC_Tools_NPC()
{
        new Tools_NPC();
}
 
Top