Hello RaGEZONERs, how are you guys doing :):
After a long day, I had 1 hour free time. my friend yesterday showed me new mode that freestyle gunz has made, it's called Roll The Dice mode. So I decided to make it in my way, and release it.
What is this mode?
This mode is as it's called Roll The Dice, which means, each time your character respawns, it will throw a dice, and you will get a number, each number has a special ability, your character will have this ability during his round, and after you die, you will revive with new dice roll, and will give you another ability.
How do I play this mode?
I decided to make it, as freestyle did, with roomtag.
Usage:
[RTD]
in room's name/title
How many rolls there are in this mode?
I made only 1-6 numbers (it's cool cuz dice has 6 faces in real life)
What is the ability for each number?
http://i58.tinypic.com/r8uz50.png
And finally the source code edits...
Okay just to mention all edits are in
Gunz.sln
ZCharacter.cpp
search for
void ZCharacter::Revival()
replace the whole function with all this
Code:
void ZCharacter::Revival()
{
//Dice Mode (By Tannous)
ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
int Tannous;
char szMsg[256];
char* power;
srand(time(NULL));
Tannous = rand()%6;
Tannous += 1;
ZGetCombatInterface()->Ability(&Tannous);
ZGetGame()->m_pMyCharacter->Ability(&Tannous);
m_pModule_Movable->Ability(&Tannous);
/////////////////////////////////////////////
if (m_bInitialized==false) return;
InitStatus();
ZCharaterStatusBitPacking& uStatus = m_dwStatusBitPackingValue.Ref();
uStatus.m_bDie = false;
m_Collision.SetCollideable(true);
if(IsAdminHide())
uStatus.m_bDie = true;
SetAnimationLower(ZC_STATE_LOWER_IDLE1);
CHECK_RETURN_CALLSTACK(Revival);
/////////////////////////////////////////////
//Dice Mode (By Tannous)
m_fPreMaxHP = (int)pCharacter->GetHP();
m_fPreMaxAP = (int)pCharacter->GetAP();
m_pModule_HPAP->SetMaxHP(m_fPreMaxHP);
m_pModule_HPAP->SetMaxAP(m_fPreMaxAP);
m_pModule_HPAP->SetHP(m_fPreMaxHP);
m_pModule_HPAP->SetAP(m_fPreMaxAP);
if(strstr(ZGetGameClient()->GetStageName(), "[RTD]")||strstr(ZGetGameClient()->GetStageName(), "[rtd]"))
{
switch(Tannous)
{
case 1:
m_fPreMaxHP = 320;
m_fPreMaxAP = 300;
m_pModule_HPAP->SetMaxHP(m_fPreMaxHP);
m_pModule_HPAP->SetMaxAP(m_fPreMaxAP);
m_pModule_HPAP->SetHP(m_fPreMaxHP);
m_pModule_HPAP->SetAP(m_fPreMaxAP);
power = "Super Tank";
break;
case 2:
m_fPreMaxHP = 20;
m_fPreMaxAP = 0;
m_pModule_HPAP->SetMaxHP(m_fPreMaxHP);
m_pModule_HPAP->SetMaxAP(m_fPreMaxAP);
m_pModule_HPAP->SetHP(m_fPreMaxHP);
m_pModule_HPAP->SetAP(m_fPreMaxAP);
power = "Near Death";
break;
case 3:
power = "ESP Mode";
break;
case 4:
power = "Super Weapons";
break;
case 5:
power = "Gravity Reduce";
break;
case 6:
power = "Normal";
break;
default:
power = "Normal";
break;
}
sprintf(szMsg, "%s: %d (%s)", "Dice result", Tannous, power);
ZChatOutput(szMsg, ZChat::CMT_SYSTEM);
}
}
ZCombatInterface.cpp
search for
void ZCombatInterface::OnDraw(MDrawContext* pDC)
inside the function, under the line
bool bDrawAllPlayerName = false;
paste this code
Code:
//Dice Mode (By Tannous)
if(strstr(ZGetGameClient()->GetStageName(), "[RTD]")||strstr(ZGetGameClient()->GetStageName(), "[rtd]"))
{
if(Tannous == 3)
{
bDrawAllPlayerName = true;
DrawAllPlayerName(pDC);
}
}
and above the function
void ZCombatInterface::OnDraw(MDrawContext* pDC)
paste this new function
Code:
//Dice Mode (By Tannous)
int Tannous;
void ZCombatInterface::Ability(int *num)
{
Tannous = *num;
}
ZMyCharacter.cpp
search for this line and replace it
Code:
ZCharacter::OnDamaged(pAttacker,srcPos,damageType,weaponType,fDamage,fPiercingRatio,nMeleeType);
with this code
Code:
//Dice Mode (By Tannous)
if((strstr(ZGetGameClient()->GetStageName(), "[RTD]")||strstr(ZGetGameClient()->GetStageName(), "[rtd]"))&&(Tannous1 == 4))
ZCharacter::OnDamaged(pAttacker,srcPos,damageType,weaponType,(fDamage*5.f),fPiercingRatio,nMeleeType);
else
ZCharacter::OnDamaged(pAttacker,srcPos,damageType,weaponType,fDamage,fPiercingRatio,nMeleeType);
and above the function
void ZMyCharacter::OnDamaged
add this new one
Code:
//Dice Mode (By Tannous)
int Tannous1;
void ZMyCharacter::Ability(int *num)
{
Tannous1 = *num;
}
ZModule_Movable.cpp
search for
void ZModule_Movable::UpdateGravity(float fDelta)
replace whole function with this
Code:
void ZModule_Movable::UpdateGravity(float fDelta)
{
//Dice Mode (By Tannous)
if((strstr(ZGetGameClient()->GetStageName(), "[RTD]")||strstr(ZGetGameClient()->GetStageName(), "[rtd]"))&&(Tannous2 == 5))
m_Velocity.z = max( m_Velocity.z - (500.f*fDelta),-MAX_FALL_SPEED);
else
m_Velocity.z = max( m_Velocity.z - GRAVITY_CONSTANT*fDelta,-MAX_FALL_SPEED);
}
and above the function paste this
Code:
//Dice Mode (By Tannous)
int Tannous2;
void ZModule_Movable::Ability(int *num)
{
Tannous2 = *num;
}
now for final step, in these 3 files (
ZCombatInterface.h,
ZMyCharacter.h,
ZModuleMovable.h)
in the public class of each file add this line
Code:
void Ability(int *num);
So I guess that's pretty much it, if anyone wants to try this live, go play freestyle gunz, it's the most organized gunz i've ever seen tho, I like its staff, they are so calm and understanding.
I didn't make any video or pictures, but imma provide the one freestyle made.
https://www.youtube.com/watch?v=QBGsBLL-br0
Credits: :cool:
Freestyle Gunz (staff) - for the great idea of this mode / and of course for the video / and some explanation
Me (Tannous) - coding this mode for ragezone members, and for each new code in the source!
Last thing, I hope you guys like it, and yeah if you want to add more stuff and rolls you can, I was just too lazy XD..
Peace Mates :thumbup:
~ Cheers Tannous