Apparently, this game mode that I never liked here in the forum is not published, so I decided to release it sorry for my bad English
1. CSCommon/Include/MBaseGameType.h
2. CSCommon/Include/MMatchRule.hCode:MMATCH_GAMETYPE_STAFF_MODE =12, // define the number that follows the previous one
3. CSCommon/Include/MMatchRuleDeathMatch.hCode:(nGameType == MMATCH_GAMETYPE_STAFF_MODE) ||
4. CSCommon/Source/MBaseGametype.cppCode:class MMatchRuleStaffMode : public MMatchRule {protected: bool CheckKillCount(MMatchObject* pOutObject); virtual void OnBegin(); virtual void OnEnd(); virtual void OnRoundTimeOut(); virtual bool OnCheckRoundFinish(); virtual bool RoundCount(); public: MMatchRuleStaffMode(MMatchStage* pStage); virtual ~MMatchRuleStaffMode() { } virtual MMATCH_GAMETYPE GetGameType() { return MMATCH_GAMETYPE_STAFF_MODE; } };
Code:#define MMATCH_GAMETYPE_STAFF_MODE_STR "Staff Mode"Code:"ST", // Staff Mode (Newbies)5. CSCommon/Source/MMatchRuleDeathMath.cppCode:_InitGameType(MMATCH_GAMETYPE_STAFF_MODE, MMATCH_GAMETYPE_STAFF_MODE, MMATCH_GAMETYPE_STAFF_MODE_STR, 1.0f, 1.0f, 0.0f);
6. CSCommon/Source/MMatchStage.cppCode://////////////////////////////////////////////////////////////////////////////////// MMatchRuleStaffMode /////////////////////////////////////////////////////////// MMatchRuleStaffMode::MMatchRuleStaffMode(MMatchStage* pStage) : MMatchRule(pStage) { } void MMatchRuleStaffMode::OnBegin() { } void MMatchRuleStaffMode::OnEnd() { } bool MMatchRuleStaffMode::RoundCount() { if (++m_nRoundCount < 1) return true; return false; } bool MMatchRuleStaffMode::CheckKillCount(MMatchObject* pOutObject) { MMatchStage* pStage = GetStage(); for (MUIDRefCache::iterator i=pStage->GetObjBegin(); i!=pStage->GetObjEnd(); i++) { MMatchObject* pObj = (MMatchObject*)(*i).second; if (pObj->GetEnterBattle() == false) continue; if (pObj->GetKillCount() >= (unsigned int)pStage->GetStageSetting()->GetRoundMax()) { pOutObject = pObj; return true; } } return false; } bool MMatchRuleStaffMode::OnCheckRoundFinish() { MMatchObject* pObject = NULL; if (CheckKillCount(pObject)) { return true; } return false; } void MMatchRuleStaffMode::OnRoundTimeOut() { SetRoundArg(MMATCH_ROUNDRESULT_DRAW); }
7. Gunz/ZGameInterface.cppCode:case MMATCH_GAMETYPE_STAFF_MODE: { return (new MMatchRuleStaffMode(this)); } break;
8. Gunz/ZRule.cppCode:ZGetGameTypeManager()->SetGameTypeStr( MMATCH_GAMETYPE_STAFF_MODE, ZMsg( MSG_MT_STAFF_MODE));
9. Gunz/ZRuleDeathMatch.cppCode:case MMATCH_GAMETYPE_STAFF_MODE: { return (new ZRuleStaffMode(pMatch)); } break;
Code:ZRuleStaffMode::ZRuleStaffMode(ZMatch* pMatch) : ZRule(pMatch) { }10. Gunz/ZRuleDeathMatch.hCode:ZRuleStaffMode::~ZRuleStaffMode() { }
11. Gunz/ZStageInterface.cppCode:class ZRuleStaffMode : public ZRule{ public: ZRuleStaffMode(ZMatch* pMatch); virtual ~ZRuleStaffMode(); };
Code:case MMATCH_GAMETYPE_STAFF_MODE:12. Gunz/ZCharacter.cppCode:(pSetting->nGameType == MMATCH_GAMETYPE_STAFF_MODE) ||
Note : here place the id of the weapons you want by means of the zitem.xml id
Note : in this part you can modify the hp and ap for the characters in the default mode I leave it in 1000 you can put as much as you wantCode:if (ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_STAFF_MODE) { m_Items.EquipItem(MMCIP_PRIMARY, 400531); // first weapon m_Items.EquipItem(MMCIP_SECONDARY, 504504); // second weapon m_Items.EquipItem(MMCIP_MELEE, 6010); // melee }
13. Gunz/ZMessage.hCode:if( ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_STAFF_MODE) { m_Property.fMaxHP.Set_CheckCrc(1000); m_fPreMaxHP = 1000; m_Property.fMaxAP.Set_CheckCrc(1000); m_fPreMaxAP = 1000; }
build matchserver and gunz...Code:#define MSG_MT_STAFF_MODE 9919 ///< Staff Mode, define the number that follows the previous one, although it doesn't matter much here
Part 2 : Matchserver / system.mrs
1. Matchserver/Message.xml
2. Matchserver/gametypecfg.xmlCode:<MSG id="9916">Staff Mode</MSG>
3. Matchserver/ChannelRule.xmlCode:<GAMETYPE id="13"> <!-- GAMETYPE_STAFF_MODE --> <ROUNDS round="10" str="10" /> <ROUNDS round="20" str="20" /> <ROUNDS round="30" str="30" /> <ROUNDS round="50" str="50" default="true" /> <ROUNDS round="70" str="70" /> <ROUNDS round="100" str="100" /> <LIMITTIME sec="99999" str="STR:GAMETYPECFG_LIMITTIME_INFINITE" /> <LIMITTIME sec="10" str="STR:GAMETYPECFG_LIMITTIME_10MIN" /> <LIMITTIME sec="20" str="STR:GAMETYPECFG_LIMITTIME_20MIN" /> <LIMITTIME sec="30" str="STR:GAMETYPECFG_LIMITTIME_30MIN" default="true" /> <LIMITTIME sec="40" str="STR:GAMETYPECFG_LIMITTIME_40MIN" /> <LIMITTIME sec="50" str="STR:GAMETYPECFG_LIMITTIME_50MIN" /> <LIMITTIME sec="60" str="STR:GAMETYPECFG_LIMITTIME_60MIN" /> <MAXPLAYERS player="4" str="4" /> <MAXPLAYERS player="8" str="8" default="true" /> <MAXPLAYERS player="12" str="12" /> <MAXPLAYERS player="16" str="16" /> </GAMETYPE>
Note : remember to place those files in your system.mrsCode:<GAMETYPE id="13" /> <!-- GAMETYPE_STAFF_MODE -->



Reply With Quote![[RELEASE] Staff Mode (Newbies)](http://ragezone.com/hyper728.png)

