Show
Ignore:
Timestamp:
11/19/08 13:51:33 (17 years ago)
Author:
yumileroy
Message:

*Merge from Mangos. Add MapReference?. Author: hunuza.
*Also re-commit the patches reverted in 255.

Original author: megamage
Date: 2008-11-18 19:40:06-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/include/sc_creature.cpp

    r229 r257  
    680680    } 
    681681 
    682     InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers(); 
    683     InstanceMap::PlayerList::const_iterator i; 
    684     for (i = PlayerList.begin(); i != PlayerList.end(); ++i) 
    685     { 
    686         if((*i)->isAlive()) 
    687             pUnit->AddThreat(*i, 0.0f); 
    688     } 
     682    Map::PlayerList const &PlayerList = map->GetPlayers(); 
     683    for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) 
     684        if (Player* i_pl = i->getSource()) 
     685            if (!i_pl->isAlive()) 
     686                pUnit->AddThreat(i_pl, 0.0f); 
    689687} 
    690688 
     
    721719    ((Player*)pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); 
    722720} 
     721 
     722void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) 
     723{ 
     724    Map *map = m_creature->GetMap(); 
     725    if (!map->IsDungeon()) 
     726        return; 
     727 
     728    Map::PlayerList const &PlayerList = map->GetPlayers(); 
     729    for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) 
     730        if (Player* i_pl = i->getSource()) 
     731            if (!i_pl->isAlive()) 
     732                i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); 
     733} 
     734 
    723735 
    724736Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)