Help About Trainers

Hey guys i have a little questions with the Trainers how i do manually a new trainer and i add the spells that i want and the class what i want?

But i use a custom class and in this days you have been changed the trainers of the classes in the emulator what i have to do?

Add the spells normally to npc_trainer and use the custom class ID in the creature_template trainer_class.

Try copying another trainer.

a little question that i have what id i have to put in Npc_trainer?

cause i dont know if is the npc entry or what

Its the NPC entry

but when i put the spell doesn’t work and i don’t know why TT

Show your work

why i have to post a custom thing in a forum that doesn’t support client modifications?

You could also provide everything that is not a client modification … for example the DB data and core changes …

simple i only add

|| CLASS_DRAKONIAN

CLASS_DRAKONIAN = 10,

QUEST_SORT_DRAKONIAN = 377

case QUEST_SORT_DRAKONIAN:      return CLASS_DRAKONIAN;

and nothing more xDDD

i add a new reature with the trainer class 10 and for human not more.
and i add one spell into the trainer and doesn’t work

How can anyone help you with your broken code if they don’t know what it is?

i’ll give you the entire patch is correct the code ¬¬

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index ebd94b8..2ec3df2 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5803,7 +5803,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
          0.036587f, // Mage
          0.024211f, // Warlock
          0.0f,      // ??
-         0.056097f  // Druid
+         0.056097f,  // Druid
+		 0.034943f // Paladin
     };
     // Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15%
     const float crit_to_dodge[MAX_CLASSES] =
@@ -5818,7 +5819,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing)
          1.00f/1.15f,    // Mage
          0.97f/1.15f,    // Warlock (?)
          0.0f,           // ??
-         2.00f/1.15f     // Druid
+         2.00f/1.15f,    // Druid
+		 1.00f/1.15f     // Paladin
     };
 
     uint8 level = getLevel();
@@ -11929,6 +11931,8 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
                             allowEquip = (itemSkill == SKILL_MAIL);
                             break;
                         case CLASS_PALADIN:
+						case CLASS_DRAKONIAN:
+							allowEquip = (itemSkill == SKILL_PLATE_MAIL);
                         case CLASS_WARRIOR:
                             allowEquip = (itemSkill == SKILL_PLATE_MAIL);
                             break;
@@ -12030,7 +12034,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
 
     if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass > ITEM_SUBCLASS_ARMOR_MISC && proto->SubClass < ITEM_SUBCLASS_ARMOR_BUCKLER && proto->InventoryType != INVTYPE_CLOAK)
     {
-        if (_class == CLASS_WARRIOR || _class == CLASS_PALADIN || _class == CLASS_DEATH_KNIGHT)
+        if (_class == CLASS_WARRIOR || _class == CLASS_PALADIN || _class == CLASS_DEATH_KNIGHT || _class == CLASS_DRAKONIAN)
         {
             if (getLevel() < 40)
             {
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index b62b512..1521da3 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5388,6 +5388,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
                     {
                         case CLASS_WARRIOR:
                         case CLASS_PALADIN:
+						case CLASS_DRAKONIAN:
                         case CLASS_DEATH_KNIGHT:
                             RandomSpells.push_back(71484);
                             RandomSpells.push_back(71491);
@@ -5434,6 +5435,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
                     {
                         case CLASS_WARRIOR:
                         case CLASS_PALADIN:
+						case CLASS_DRAKONIAN:
                         case CLASS_DEATH_KNIGHT:
                             RandomSpells.push_back(71561);
                             RandomSpells.push_back(71559);
@@ -6295,6 +6297,58 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
             }
             break;
         }
+		// caballero dragon
+		case SPELLFAMILY_DRAKONIAN:
+		{
+			if (dummySpell->Id == 53651)
+            {
+                if (!victim)
+                    return false;
+                triggered_spell_id = 0;
+                Unit* beaconTarget = NULL;
+                if (GetTypeId() != TYPEID_PLAYER)
+                {
+                    beaconTarget = triggeredByAura->GetBase()->GetCaster();
+                    if (!beaconTarget || beaconTarget == this || !(beaconTarget->GetAura(53563, victim->GetGUID())))
+                        return false;
+                    basepoints0 = int32(damage);
+                    triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(635)) ? 53652 : 53654;
+                }
+                else
+                {    // Check Party/Raid Group
+                    if (Group* group = ToPlayer()->GetGroup())
+                    {
+                        for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+                        {
+                            if (Player* member = itr->getSource())
+                            {
+                                // check if it was heal by paladin which casted this beacon of light
+                                if (member->GetAura(53563, victim->GetGUID()))
+                                {
+                                    // do not proc when target of beacon of light is healed
+                                    if (member == this)
+                                        return false;
+
+                                    beaconTarget = member;
+                                    basepoints0 = int32(damage);
+                                    triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(635)) ? 53652 : 53654;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+
+                if (triggered_spell_id && beaconTarget)
+                {
+                    victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true);
+                    return true;
+                }
+
+                return false;
+            }
+		}
+		// fin caballero dragon
            case CLASS_SHAMAN:
                val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f;
                break;
			case CLASS_DRAKONIAN:
                val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f;
                break;	
            case CLASS_DRUID:
            {
                // Check if Predatory Strikes is skilled
@@ -637,8 +640,9 @@ const float m_diminishing_k[MAX_CLASSES] =
    0.9880f,  // Shaman
    0.9830f,  // Mage
    0.9830f,  // Warlock
    0.0f,     // ??
    0.9720f   // Druid
    0.9560f,  // ??
    0.9720f,   // Druid
	0.9560f
};

float Player::GetMissPercentageFromDefence() const
@@ -654,8 +658,9 @@ float Player::GetMissPercentageFromDefence() const
        16.00f,     // Shaman  //?
        16.00f,     // Mage    //?
        16.00f,     // Warlock //?
        0.0f,       // ??
        16.00f      // Druid   //?
        16.00f,     // ??
        16.00f,      // Druid   //?
		16.00f
    };

    float diminishing = 0.0f, nondiminishing = 0.0f;
@@ -681,8 +686,9 @@ void Player::UpdateParryPercentage()
        145.560408f,    // Shaman
        0.0f,           // Mage
        0.0f,           // Warlock
        0.0f,           // ??
        0.0f            // Druid
        47.003525f,           // ??
        0.0f,            // Druid
		47.003525f
    };

    // No parry
@@ -718,8 +724,9 @@ void Player::UpdateDodgePercentage()
        145.560408f,    // Shaman
        150.375940f,    // Mage
        150.375940f,    // Warlock
        0.0f,           // ??
        116.890707f     // Druid
        88.129021f,     // ??
        116.890707f,    // Druid
		88.129021f
    };

    float diminishing = 0.0f, nondiminishing = 0.0f;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 2290a7c..083d662 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3685,6 +3685,13 @@ void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, Play
                 info->stats[STAT_AGILITY]   += (lvl > 38 ? 2: (lvl > 8 && (lvl%2) ? 1: 0));
                 info->stats[STAT_INTELLECT] += (lvl > 38 ? 3: (lvl > 4 ? 1: 0));
                 info->stats[STAT_SPIRIT]    += (lvl > 38 ? 3: (lvl > 5 ? 1: 0));
+			case CLASS_DRAKONIAN:
+                info->stats[STAT_STRENGTH]  += (lvl > 3  ? 1: 0);
+                info->stats[STAT_STAMINA]   += (lvl > 33 ? 2: (lvl > 1 ? 1: 0));
+                info->stats[STAT_AGILITY]   += (lvl > 38 ? 1: (lvl > 7 && !(lvl%2) ? 1: 0));
+                info->stats[STAT_INTELLECT] += (lvl > 6 && (lvl%2) ? 1: 0);
+                info->stats[STAT_SPIRIT]    += (lvl > 7 ? 1: 0);
+                break;
         }
     }
 }
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index b1b1e12..2326b3c 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -2706,7 +2706,8 @@ enum QuestSort
     QUEST_SORT_JEWELCRAFTING       = 373,
     QUEST_SORT_NOBLEGARDEN         = 374,
     QUEST_SORT_PILGRIMS_BOUNTY     = 375,
-    QUEST_SORT_LOVE_IS_IN_THE_AIR  = 376
+    QUEST_SORT_LOVE_IS_IN_THE_AIR  = 376,
+	QUEST_SORT_DRAKONIAN           = 377
 };
 
 inline uint8 ClassByQuestSort(int32 QuestSort)
@@ -2723,6 +2724,7 @@ inline uint8 ClassByQuestSort(int32 QuestSort)
         case QUEST_SORT_PRIEST:         return CLASS_PRIEST;
         case QUEST_SORT_DRUID:          return CLASS_DRUID;
         case QUEST_SORT_DEATH_KNIGHT:   return CLASS_DEATH_KNIGHT;
+		case QUEST_SORT_DRAKONIAN:      return CLASS_DRAKONIAN;
     }
     return 0;
 }
@@ -3371,7 +3373,8 @@ enum SpellFamilyNames
     // 14 - unused
     SPELLFAMILY_DEATHKNIGHT = 15,
     // 16 - unused
-    SPELLFAMILY_PET         = 17
+    SPELLFAMILY_PET         = 17,
+	SPELLFAMILY_DRAKONIAN   = 18
 };
@@ -106,18 +111,18 @@ enum Classes
    CLASS_SHAMAN        = 7,
    CLASS_MAGE          = 8,
    CLASS_WARLOCK       = 9,
    //CLASS_UNK           = 10,
    CLASS_DRAKONIAN     = 10,
    CLASS_DRUID         = 11
};

// max+1 for player class
#define MAX_CLASSES       12
#define MAX_CLASSES       13

#define CLASSMASK_ALL_PLAYABLE 
    ((1<<(CLASS_WARRIOR-1))|(1<<(CLASS_PALADIN-1))|(1<<(CLASS_HUNTER-1))| 
    (1<<(CLASS_ROGUE-1))  |(1<<(CLASS_PRIEST-1)) |(1<<(CLASS_SHAMAN-1))| 
    (1<<(CLASS_MAGE-1))   |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1)) | 
    (1<<(CLASS_DEATH_KNIGHT-1)))
    (1<<(CLASS_ROGUE-1))  |(1<<(CLASS_PRIEST-1)) |(1<<(CLASS_DEATH_KNIGHT-1))| 
    (1<<(CLASS_SHAMAN-1))   |(1<<(CLASS_MAGE-1))|(1<<(CLASS_WARLOCK-1)) | 
    (1<<(CLASS_DRAKONIAN-1))|(1<<(CLASS_DRUID-1)))