⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 worldmonster.cpp.svn-base

📁 ROSE的源代码。了解的自己研究,编译通过
💻 SVN-BASE
字号:
/*
    Rose Online Server Emulator
    Copyright (C) 2006,2007 OSRose Team http://www.osrose.net
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

    depeloped with Main erose/hrose source server + some change from the original eich source        
*/
#include "worldmonster.h"

// Monster Contructor
CMonster::CMonster( fPoint MonsterPosition, UINT MonsterType, UINT MonsterMap, UINT Owner, UINT spawnid )
{
    montype = MonsterType;
    SpawnTime = clock( );
    lastSighCheck = clock( );
    MonsterDrop = NULL;    
    Position->source = MonsterPosition;
    Position->current = MonsterPosition;
    Position->destiny = MonsterPosition; //MONSTER CONSTRUCTOR
    Position->Map = MonsterMap;
    Position->respawn = spawnid;
    Position->lastMoveTime = clock( );
    // Magic status (buffs)   
    for(unsigned int i=0;i<30;i++)
    {
        MagicStatus[i].Buff = 0;
        MagicStatus[i].Value = 0;        
        MagicStatus[i].Duration = 0;    
        MagicStatus[i].BuffTime = 0;                    
    }	      	    
    
    // Monster drop
    MonsterDrop = new MDrop;
    assert(MonsterDrop);
    MonsterDrop->drop = false; 
    MonsterDrop->firsthit = 0;
    MonsterDrop->firstlevel = 0;
    MonsterDrop->mobdrop = NULL;
    MonsterDrop->mapdrop = NULL;           		
    clientid = GServer->GetNewClientID();  	
    owner = Owner;	
    thisparty = NULL; 	
    if(owner==0) CharType = TMONSTER;
    else CharType = TSUMMON;
        
}
    
// Monster destructor
CMonster::~CMonster( )
{
    if(MonsterDrop!=NULL)
        delete MonsterDrop;       
    for(UINT i=0;i<PlayersDamage.size();i++)         
        delete PlayersDamage.at(i);
    PlayersDamage.clear();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -