[Help] Monster Regen after Die (c++ dev issue)

Results 1 to 3 of 3
  1. #1
    Account Upgraded | Title Enabled! thevjfla is offline
    MemberRank
    Apr 2012 Join Date
    203Posts

    [Help] Monster Regen after Die (c++ dev issue)

    Im creating a simple event and im experimenting issues with the monster.

    I need take off the regen of the monsters, when die, stays die. And with my code, the monsters regen after die.

    Code:
    int MobPos = gObjMonsterAdd(this->Monster[iMonCount].MonsterIndex, this->Monster[iMonCount].Map, this->Monster[iMonCount].X, this->Monster[iMonCount].Y);
    
    			if (MobPos >= 0)
    			{
    				int MobID = gObjAddMonster(this->Monster[iMonCount].Map);
    				if (MobID >= 0)
    				{
    					gObjSetPosMonster(MobID, MobPos);
    					gObjSetMonster(MobID, this->Monster[iMonCount].MonsterIndex);
    					
    					if (this->Monster[iMonCount].Boss == 0) { gObj[MobID].m_Attribute = 99; }
    					if (this->Monster[iMonCount].Boss == 0) { gObj[MobID].m_Attribute = 98; }
    
    					// Monster stats 
    					gObj[MobID].m_AttackDamageMin = this->Monster[iMonCount].AttackDamageMin;
    					gObj[MobID].m_AttackDamageMax = this->Monster[iMonCount].AttackDamageMax;
    					gObj[MobID].Dir = this->Monster[iMonCount].Dir;
    					gObj[MobID].m_Defense = this->Monster[iMonCount].Defense;
    					gObj[MobID].m_SuccessfulBlocking = 700;
    					gObj[MobID].Live = 1;
    					gObj[MobID].DieRegen = 0;
    					gObj[MobID].MaxRegenTime = 100000;
    					gObj[MobID].RegenTime = 100000;
    					gObj[MobID].m_State = 1;
    					gObj[MobID].MaxLife = this->Monster[iMonCount].Life;
    					gObj[MobID].Life = this->Monster[iMonCount].Life;
    					gObj[MobID].Dir = this->Monster[iMonCount].Dir;
    					gObj[MobID].m_MoveRange = 0;
    					);
    				}
    			}
    Any ideas?


  2. #2

    Re: [Help] Monster Regen after Die (c++ dev issue)

    Quote Originally Posted by thevjfla View Post
    Im creating a simple event and im experimenting issues with the monster.

    I need take off the regen of the monsters, when die, stays die. And with my code, the monsters regen after die.

    Code:
    int MobPos = gObjMonsterAdd(this->Monster[iMonCount].MonsterIndex, this->Monster[iMonCount].Map, this->Monster[iMonCount].X, this->Monster[iMonCount].Y);
    
    if (MobPos >= 0)
    {
    int MobID = gObjAddMonster(this->Monster[iMonCount].Map);
    if (MobID >= 0)
    {
    gObjSetPosMonster(MobID, MobPos);
    gObjSetMonster(MobID, this->Monster[iMonCount].MonsterIndex);
    
    if (this->Monster[iMonCount].Boss == 0) { gObj[MobID].m_Attribute = 99; }
    if (this->Monster[iMonCount].Boss == 0) { gObj[MobID].m_Attribute = 98; }
    
    // Monster stats 
    gObj[MobID].m_AttackDamageMin = this->Monster[iMonCount].AttackDamageMin;
    gObj[MobID].m_AttackDamageMax = this->Monster[iMonCount].AttackDamageMax;
    gObj[MobID].Dir = this->Monster[iMonCount].Dir;
    gObj[MobID].m_Defense = this->Monster[iMonCount].Defense;
    gObj[MobID].m_SuccessfulBlocking = 700;
    gObj[MobID].Live = 1;
    gObj[MobID].DieRegen = 0;
    gObj[MobID].MaxRegenTime = 100000;
    gObj[MobID].RegenTime = 100000;
    gObj[MobID].m_State = 1;
    gObj[MobID].MaxLife = this->Monster[iMonCount].Life;
    gObj[MobID].Life = this->Monster[iMonCount].Life;
    gObj[MobID].Dir = this->Monster[iMonCount].Dir;
    gObj[MobID].m_MoveRange = 0;
    );
    }
    }
    Any ideas?
    Why not make monster respawn in 999999999.. seconds and thats like never?

    Sent from my Redmi 5 using Tapatalk

  3. #3
    Account Upgraded | Title Enabled! thevjfla is offline
    MemberRank
    Apr 2012 Join Date
    203Posts

    Re: [Help] Monster Regen after Die (c++ dev issue)

    Quote Originally Posted by KarLi View Post
    Why not make monster respawn in 999999999.. seconds and thats like never?

    Sent from my Redmi 5 using Tapatalk
    Hello @KarLi, merry xmas bro! :D

    The respawn time its gObj[MobID].RegenTime?

    Thats maybe works for me, in 10 mins the event delete all objects to the next hour.



Advertisement