• 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++] Profession npc

Synth

Exalted Member
Hello Emudevs,today i'm releasing an profession NPC gotten from Sdyess release some time ago, and it was updated by Jameyboor.So I decided to release it to you guys on Emudevs,it was released on a website by Ghostcrawler336.

Script info:
This npc will allow you to learn up to two professions noting much about it.

SQL:
-- Professions 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`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified`) VALUES (700014, 0, 0, 0, 0, 0, 24454, 0, 0, 0, 'Professions', 'Emudevs', NULL, 0, 80, 80, 0, 35, 35, 1, 1, 1.14286, 1.5, 0, 13, 17, 0, 42, 1, 1500, 0, 1, 512, 2048, 8, 0, 0, 0, 0, 0, 9, 13, 100, 7, 0, 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, 2, 'Professions_NPC', 12340);

Script:
Professions NPC - C++ - EmuDevs Paste

If you find any bug or errors once you compile feel free to ask me!
Thank you!
Best regards,
Synth !
 
Last edited by a moderator:

bromia

Enthusiast
Compile error with fresh trinitycore :(

Error 1 error C2039: 'outError' : is not a member of 'Log' C:\Source\TrinityCore2\src\server\scripts\Custom\professions_npc.cpp 89 1 scripts
Error 2 error C2065: 'LOG_FILTER_PLAYER_SKILLS' : undeclared identifier C:\Source\TrinityCore2\src\server\scripts\Custom\professions_npc.cpp 89 1 scripts
 

bromia

Enthusiast
Thx, working :)

Edit: Npc need SQL update!

I fix, but little custom from stat's. why? I create new row from creature_template, and write new stat... (HP, Mana, Armor) Any stat's copy from original = untouched!

Fix:
Code:
INSERT INTO `world`.`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 ('700014', '0', '0', '0', '0', '0', '24454', '0', '0', '0', 'Professions', 'Emudevs', '', '0', '80', '80', '0', '35', '35', '1', '1', '1', '1', '3', '1000', '20000', '0', '0', '1', '2000', '2000', '1', '512', '2048', '8', '0', '0', '0', '0', '0', '0', '0', '0', '13', '100', '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '', '1', '1', '1', '3', '3', '3', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '2', 'Professions_NPC', '12340');
 
Last edited:

Synth

Exalted Member
Thx, working :)

Edit: Npc need SQL update!

I fix, but little custom from stat's. why? I create new row from creature_template, and write new stat... (HP, Mana, Armor) Any stat's copy from original = untouched!

Fix:
Code:
INSERT INTO `world`.`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 ('700014', '0', '0', '0', '0', '0', '24454', '0', '0', '0', 'Professions', 'Emudevs', '', '0', '80', '80', '0', '35', '35', '1', '1', '1', '1', '3', '1000', '20000', '0', '0', '1', '2000', '2000', '1', '512', '2048', '8', '0', '0', '0', '0', '0', '0', '0', '0', '13', '100', '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '', '1', '1', '1', '3', '3', '3', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '2', 'Professions_NPC', '12340');
Thank you :smile:

- - - Updated - - -

Thx, working :)

Edit: Npc need SQL update!

I fix, but little custom from stat's. why? I create new row from creature_template, and write new stat... (HP, Mana, Armor) Any stat's copy from original = untouched!

Fix:
Thank you :smile:
 

Demonid

Enthusiast
To fix the MonsterWhisper error change GetGUID to ToPlayer

For example:

_creature->MonsterWhisper(text, pPlayer->GetGUID());

to

_creature->MonsterWhisper(text, pPlayer->ToPlayer());
 

jeremymeile

Enthusiast
Very nice but...

if you already learned first aid or cooking you cannot learn it from the npc... is there a way to delete these before the npc add you the new profession?
 

Tommy

Founder
To fix the MonsterWhisper error change GetGUID to ToPlayer

For example:

_creature->MonsterWhisper(text, pPlayer->GetGUID());

to

_creature->MonsterWhisper(text, pPlayer->ToPlayer());

Why are you calling 'ToPlayer()' when 'pPlayer' is Player*? It should be:

Code:
_creature->MonsterWhisper(text, pPlayer);

Very nice but...

if you already learned first aid or cooking you cannot learn it from the npc... is there a way to delete these before the npc add you the new profession?

What do you mean? Those are secondary skills, why would you want to remove them?

I'll redo the script, it is poorly coded (or updated), outdated and ignores a lot of easy functions to call for some of this for simplification..

Updated: http://paste.emudevs.com/?paste=43
 

Blazeqts

Enthusiast
Tommy, can you make it so the amount of skill you get from taking a profession is only 150, and not 450? :) Would appreciate it!
 
Top