full implementation of viano dungeon bots
This commit is contained in:
1 parent
634606b5ba
commit
96c937d5e4
5 files changed
+4538
-24
No files matched your search
@@ -46,6 +46,39 @@ namespace VianoAdventurers
|
|||||||
|| scriptName.rfind("npc_alliance_adventurer_tank", 0) == 0;
|
|| scriptName.rfind("npc_alliance_adventurer_tank", 0) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIANO_FACTION_MODELS_V1
|
||||||
|
static uint32 GetVianoAdventurerDisplayId(Creature* creature)
|
||||||
|
{
|
||||||
|
static constexpr uint32 HORDE_MODELS[] =
|
||||||
|
{
|
||||||
|
30063,
|
||||||
|
30064,
|
||||||
|
30065,
|
||||||
|
30066
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr uint32 ALLIANCE_MODELS[] =
|
||||||
|
{
|
||||||
|
24361,
|
||||||
|
24541,
|
||||||
|
24543,
|
||||||
|
24542
|
||||||
|
};
|
||||||
|
|
||||||
|
uint32 const* models = HORDE_MODELS;
|
||||||
|
|
||||||
|
if (creature)
|
||||||
|
{
|
||||||
|
uint32 const entry = creature->GetEntry();
|
||||||
|
|
||||||
|
if (entry >= 900004 && entry <= 900006)
|
||||||
|
models = ALLIANCE_MODELS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return models[urand(0, 3)];
|
||||||
|
}
|
||||||
|
|
||||||
static void GetVianoFollowSlot(Creature* bot, Player* owner, float& distance, float& angle)
|
static void GetVianoFollowSlot(Creature* bot, Player* owner, float& distance, float& angle)
|
||||||
{
|
{
|
||||||
distance = FOLLOW_DISTANCE;
|
distance = FOLLOW_DISTANCE;
|
||||||
@@ -316,20 +349,18 @@ namespace VianoAdventurers
|
|||||||
me->SetFaction(owner->GetFaction());
|
me->SetFaction(owner->GetFaction());
|
||||||
me->SetLevel(owner->getLevel());
|
me->SetLevel(owner->getLevel());
|
||||||
me->UpdateLevelDependantStats();
|
me->UpdateLevelDependantStats();
|
||||||
|
uint32 const displayId =
|
||||||
|
GetVianoAdventurerDisplayId(me);
|
||||||
static constexpr uint32 HORDE_ADVENTURER_MODELS[] =
|
|
||||||
{
|
|
||||||
30063,
|
|
||||||
30064,
|
|
||||||
30065,
|
|
||||||
30066
|
|
||||||
};
|
|
||||||
uint32 displayId = HORDE_ADVENTURER_MODELS[urand(0, 3)];
|
|
||||||
|
|
||||||
me->SetDisplayId(displayId, true);
|
me->SetDisplayId(displayId, true);
|
||||||
|
|
||||||
TC_LOG_INFO("scripts","[VianoAI] Horde adventurer display selected: %u", displayId);
|
TC_LOG_INFO(
|
||||||
|
"scripts",
|
||||||
|
"[VianoAI] adventurer display selected: "
|
||||||
|
"entry=%u display=%u",
|
||||||
|
me->GetEntry(),
|
||||||
|
displayId);
|
||||||
|
|
||||||
|
|
||||||
// REACT_PASSIVE lets AttackStart() briefly set a victim, but the
|
// REACT_PASSIVE lets AttackStart() briefly set a victim, but the
|
||||||
// core subsequently drops that victim again. We already suppress
|
// core subsequently drops that victim again. We already suppress
|
||||||
@@ -1095,16 +1126,11 @@ namespace VianoAdventurers
|
|||||||
me->SetFaction(owner->GetFaction());
|
me->SetFaction(owner->GetFaction());
|
||||||
me->SetLevel(owner->getLevel());
|
me->SetLevel(owner->getLevel());
|
||||||
me->UpdateLevelDependantStats();
|
me->UpdateLevelDependantStats();
|
||||||
|
uint32 const displayId =
|
||||||
|
GetVianoAdventurerDisplayId(me);
|
||||||
|
|
||||||
static constexpr uint32 HORDE_ADVENTURER_MODELS[] =
|
me->SetDisplayId(displayId, true);
|
||||||
{
|
|
||||||
30063,
|
|
||||||
30064,
|
|
||||||
30065,
|
|
||||||
30066
|
|
||||||
};
|
|
||||||
|
|
||||||
me->SetDisplayId(HORDE_ADVENTURER_MODELS[urand(0, 3)], true);
|
|
||||||
SetEquipmentSlots(false, 50179, 50794, EQUIP_NO_CHANGE);
|
SetEquipmentSlots(false, 50179, 50794, EQUIP_NO_CHANGE);
|
||||||
me->SetReactState(REACT_DEFENSIVE);
|
me->SetReactState(REACT_DEFENSIVE);
|
||||||
|
|
||||||
@@ -1517,9 +1543,11 @@ namespace VianoAdventurers
|
|||||||
me->SetLevel(owner->getLevel());
|
me->SetLevel(owner->getLevel());
|
||||||
me->UpdateLevelDependantStats();
|
me->UpdateLevelDependantStats();
|
||||||
ConfigureMana(true);
|
ConfigureMana(true);
|
||||||
|
uint32 const displayId =
|
||||||
|
GetVianoAdventurerDisplayId(me);
|
||||||
|
|
||||||
|
me->SetDisplayId(displayId, true);
|
||||||
|
|
||||||
static constexpr uint32 MODELS[] = { 30063, 30064, 30065, 30066 };
|
|
||||||
me->SetDisplayId(MODELS[urand(0, 3)], true);
|
|
||||||
SetEquipmentSlots(false, 39426, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
|
SetEquipmentSlots(false, 39426, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
FollowOwner(owner);
|
FollowOwner(owner);
|
||||||
@@ -1674,6 +1702,57 @@ void UpdateAI(uint32 diff) override
|
|||||||
return new npc_horde_adventurer_healerAI(creature);
|
return new npc_horde_adventurer_healerAI(creature);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// VIANO_ALLIANCE_ADVENTURERS_V1
|
||||||
|
//
|
||||||
|
// Alliance adventurers intentionally reuse the same combat AI as their
|
||||||
|
// Horde counterparts. Faction, models and default equipment are supplied
|
||||||
|
// by their own creature_template rows.
|
||||||
|
|
||||||
|
class npc_alliance_adventurer_melee : public CreatureScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
npc_alliance_adventurer_melee()
|
||||||
|
: CreatureScript("npc_alliance_adventurer_melee")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatureAI* GetAI(Creature* creature) const override
|
||||||
|
{
|
||||||
|
return new npc_horde_adventurer_melee::
|
||||||
|
npc_horde_adventurer_meleeAI(creature);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class npc_alliance_adventurer_tank : public CreatureScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
npc_alliance_adventurer_tank()
|
||||||
|
: CreatureScript("npc_alliance_adventurer_tank")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatureAI* GetAI(Creature* creature) const override
|
||||||
|
{
|
||||||
|
return new npc_horde_adventurer_tank::
|
||||||
|
npc_horde_adventurer_tankAI(creature);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class npc_alliance_adventurer_healer : public CreatureScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
npc_alliance_adventurer_healer()
|
||||||
|
: CreatureScript("npc_alliance_adventurer_healer")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatureAI* GetAI(Creature* creature) const override
|
||||||
|
{
|
||||||
|
return new npc_horde_adventurer_healer::
|
||||||
|
npc_horde_adventurer_healerAI(creature);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_viano_adventurers()
|
void AddSC_viano_adventurers()
|
||||||
@@ -1682,4 +1761,7 @@ void AddSC_viano_adventurers()
|
|||||||
new npc_horde_adventurer_melee();
|
new npc_horde_adventurer_melee();
|
||||||
new npc_horde_adventurer_tank();
|
new npc_horde_adventurer_tank();
|
||||||
new npc_horde_adventurer_healer();
|
new npc_horde_adventurer_healer();
|
||||||
|
new npc_alliance_adventurer_melee();
|
||||||
|
new npc_alliance_adventurer_tank();
|
||||||
|
new npc_alliance_adventurer_healer();
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
+1739
File diff suppressed because it is too large.
Load diff
@@ -436,9 +436,9 @@ enum VcoreDungeonHornNpcs
|
|||||||
NPC_HORDE_ADVENTURER_HEALER = 900003,
|
NPC_HORDE_ADVENTURER_HEALER = 900003,
|
||||||
|
|
||||||
// TODO: replace once Alliance creature templates exist.
|
// TODO: replace once Alliance creature templates exist.
|
||||||
NPC_ALLIANCE_ADVENTURER_DAMAGE = 0,
|
NPC_ALLIANCE_ADVENTURER_DAMAGE = 900004,
|
||||||
NPC_ALLIANCE_ADVENTURER_TANK = 0,
|
NPC_ALLIANCE_ADVENTURER_TANK = 900005,
|
||||||
NPC_ALLIANCE_ADVENTURER_HEALER = 0
|
NPC_ALLIANCE_ADVENTURER_HEALER = 900006
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr uint32 VCORE_DUNGEON_GROUP_LIMIT = 5;
|
static constexpr uint32 VCORE_DUNGEON_GROUP_LIMIT = 5;
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user