Beispiel #1
0
void PerlembParser::ExportMobVariables(bool isPlayerQuest, bool isGlobalPlayerQuest, bool isGlobalNPC, bool isItemQuest,
                                       bool isSpellQuest, std::string &package_name, Mob *mob, NPC *npcmob)
{
    uint8 fac = 0;
    if (mob && mob->IsClient()) {
        ExportVar(package_name.c_str(), "uguild_id", mob->CastToClient()->GuildID());
        ExportVar(package_name.c_str(), "uguildrank", mob->CastToClient()->GuildRank());
        ExportVar(package_name.c_str(), "status", mob->CastToClient()->Admin());
    }

    if(!isPlayerQuest && !isGlobalPlayerQuest && !isItemQuest) {
        if (mob && npcmob && mob->IsClient()) {
            Client* client = mob->CastToClient();

            fac = client->GetFactionLevel(client->CharacterID(), npcmob->GetID(), client->GetRace(),
                                          client->GetClass(), client->GetDeity(), npcmob->GetPrimaryFaction(), npcmob);
        }
    }

    if(mob) {
        ExportVar(package_name.c_str(), "name", mob->GetName());
        ExportVar(package_name.c_str(), "race", GetRaceName(mob->GetRace()));
        ExportVar(package_name.c_str(), "class", GetEQClassName(mob->GetClass()));
        ExportVar(package_name.c_str(), "ulevel", mob->GetLevel());
        ExportVar(package_name.c_str(), "userid", mob->GetID());
    }

    if(!isPlayerQuest && !isGlobalPlayerQuest && !isItemQuest && !isSpellQuest)
    {
        if (npcmob)
        {
            ExportVar(package_name.c_str(), "mname", npcmob->GetName());
            ExportVar(package_name.c_str(), "mobid", npcmob->GetID());
            ExportVar(package_name.c_str(), "mlevel", npcmob->GetLevel());
            ExportVar(package_name.c_str(), "hpratio",npcmob->GetHPRatio());
            ExportVar(package_name.c_str(), "x", npcmob->GetX() );
            ExportVar(package_name.c_str(), "y", npcmob->GetY() );
            ExportVar(package_name.c_str(), "z", npcmob->GetZ() );
            ExportVar(package_name.c_str(), "h", npcmob->GetHeading() );
            if(npcmob->GetTarget()) {
                ExportVar(package_name.c_str(), "targetid", npcmob->GetTarget()->GetID());
                ExportVar(package_name.c_str(), "targetname", npcmob->GetTarget()->GetName());
            }
        }

        if (fac) {
            ExportVar(package_name.c_str(), "faction", itoa(fac));
        }
    }
}
Beispiel #2
0
void HateList::DoFactionHits(int32 npc_faction_level_id) {
	if (npc_faction_level_id <= 0)
		return;
	auto iterator = list.begin();
	while (iterator != list.end())
	{
		Client *client;

		if ((*iterator)->entity_on_hatelist && (*iterator)->entity_on_hatelist->IsClient())
			client = (*iterator)->entity_on_hatelist->CastToClient();
		else
			client = nullptr;

		if (client)
			client->SetFactionLevel(client->CharacterID(), npc_faction_level_id, client->GetBaseClass(), client->GetBaseRace(), client->GetDeity());
		++iterator;
	}
}
Beispiel #3
0
void HateList::DoFactionHits(int32 nfl_id) {
	if (nfl_id <= 0)
		return;
	auto iterator = list.begin();
	while(iterator != list.end())
	{
		Client *p;

		if ((*iterator)->ent && (*iterator)->ent->IsClient())
			p = (*iterator)->ent->CastToClient();
		else
			p = nullptr;

		if (p)
			p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetBaseClass(), p->GetBaseRace(), p->GetDeity());
		++iterator;
	}
}
Beispiel #4
0
void HateList::DoFactionHits(sint32 nfl_id) {
	if (nfl_id <= 0)
		return;
    LinkedListIterator<tHateEntry*> iterator(list);
    iterator.Reset();
	while(iterator.MoreElements())
    {
        Client *p;

        if (iterator.GetData()->ent && iterator.GetData()->ent->IsClient())
            p = iterator.GetData()->ent->CastToClient();
        else
            p = NULL;

        if (p)
			p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetClass(), p->GetRace(), p->GetDeity());
        iterator.Advance();
    }
}
Beispiel #5
0
void HateList::DoFactionHits(sint32 nfl_id) {
	if (nfl_id <= 0)
		return;
    LinkedListIterator<tHateEntry*> iterator(list);
    iterator.Reset();
	while(iterator.MoreElements())
    {
        Client *p;

        if (iterator.GetData()->ent && iterator.GetData()->ent->IsClient())
            p = iterator.GetData()->ent->CastToClient();
        else
            p = NULL;

        if (p)
			p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetClass(), p->GetRace(), p->GetDeity());
        iterator.Advance();
		//Yeahlight: Zone freeze debug
		if(ZONE_FREEZE_DEBUG && rand()%ZONE_FREEZE_DEBUG == 1)
			EQC_FREEZE_DEBUG(__LINE__, __FILE__);
    }
}