Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #ifdef __FreeBSD__
- #include <md5.h>
- #else
- #include "../../libthecore/include/xmd5.h"
- #endif
- #include "utils.h"
- #include "config.h"
- #include "desc_client.h"
- #include "desc_manager.h"
- #include "char.h"
- #include "char_manager.h"
- #include "motion.h"
- #include "packet.h"
- #include "affect.h"
- #include "pvp.h"
- #include "start_position.h"
- #include "party.h"
- #include "guild_manager.h"
- #include "p2p.h"
- #include "dungeon.h"
- #include "messenger_manager.h"
- #include "war_map.h"
- #include "questmanager.h"
- #include "item_manager.h"
- #include "monarch.h"
- #include "mob_manager.h"
- #include "dev_log.h"
- #include "item.h"
- #include "arena.h"
- #include "buffer_manager.h"
- #include "unique_item.h"
- #include "threeway_war.h"
- #include "log.h"
- #if defined(ENABLE_COMBAT_ZONE)
- #include "combat_zone.h"
- #endif
- #include "../../common/VnumHelper.h"
- #ifdef ENABLE_NEWPET_SYSTEM
- #include "New_PetSystem.h"
- #endif
- #ifdef __AUCTION__
- #include "auction_manager.h"
- #endif
- #ifdef ENABLE_12ZI
- #include "zodiac_temple.h"
- #endif
- #ifdef ENABLE_DS_CHANGE_ATTR
- #include "DragonSoul.h"
- #endif
- ACMD(do_user_horse_ride)
- {
- if (ch->IsObserverMode())
- return;
- if (ch->IsDead() || ch->IsStun())
- return;
- if (ch->IsHorseRiding() == false)
- {
- // ¸»ہج ¾ئ´ر ´ظ¸¥إ»°حہ» إ¸°يہض´ظ.
- if (ch->GetMountVnum())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہج¹ج إ»°حہ» ہج؟ëءكہش´د´ظ."));
- return;
- }
- if (ch->GetHorse() == NULL)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» ¸صہْ ¼زب¯اطءض¼¼؟ن."));
- return;
- }
- ch->StartRiding();
- }
- else
- {
- ch->StopRiding();
- }
- }
- ACMD(do_user_horse_back)
- {
- if (ch->GetHorse() != NULL)
- {
- ch->HorseSummon(false);
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» µ¹·ء؛¸³آ½ہ´د´ظ."));
- }
- else if (ch->IsHorseRiding() == true)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»؟،¼ ¸صہْ ³»·ء¾ك اص´د´ظ."));
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» ¸صہْ ¼زب¯اطءض¼¼؟ن."));
- }
- }
- ACMD(do_user_horse_feed)
- {
- // °³ہخ»َء،ہ» ؟¬ »َإآ؟،¼´آ ¸» ¸شہج¸¦ ءظ ¼ِ ¾ّ´ظ.
- if (ch->GetMyShop())
- return;
- if (ch->GetHorse() == NULL)
- {
- if (ch->IsHorseRiding() == false)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» ¸صہْ ¼زب¯اطءض¼¼؟ن."));
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» إ؛ »َإآ؟،¼´آ ¸شہج¸¦ ءظ ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- DWORD dwFood = ch->GetHorseGrade() + 50054 - 1;
- if (ch->CountSpecifyItem(dwFood) > 0)
- {
- ch->RemoveSpecifyItem(dwFood, 1);
- ch->FeedHorse();
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»؟،°ش %s%s ءض¾ْ½ہ´د´ظ."),
- ITEM_MANAGER::instance().GetTable(dwFood)->szLocaleName,
- "");
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ¾ئہجإغہج ات؟ناص´د´ظ"), ITEM_MANAGER::instance().GetTable(dwFood)->szLocaleName);
- }
- }
- #define MAX_REASON_LEN 128
- EVENTINFO(TimedEventInfo)
- {
- DynamicCharacterPtr ch;
- int subcmd;
- int left_second;
- char szReason[MAX_REASON_LEN];
- TimedEventInfo()
- : ch()
- , subcmd( 0 )
- , left_second( 0 )
- {
- ::memset( szReason, 0, MAX_REASON_LEN );
- }
- };
- #ifdef ENABLE_MOVE_CHANNEL
- EVENTINFO(ChangeChannelEventInfo)
- {
- DynamicCharacterPtr ch;
- int channel_number;
- int left_second;
- ChangeChannelEventInfo()
- : ch()
- , channel_number( 0 )
- , left_second( 0 )
- {
- }
- };
- #endif
- struct SendDisconnectFunc
- {
- void operator () (LPDESC d)
- {
- if (d->GetCharacter())
- {
- if (d->GetCharacter()->GetGMLevel() == GM_PLAYER)
- d->GetCharacter()->ChatPacket(CHAT_TYPE_COMMAND, "quit Shutdown(SendDisconnectFunc)");
- }
- }
- };
- struct DisconnectFunc
- {
- void operator () (LPDESC d)
- {
- if (d->GetType() == DESC_TYPE_CONNECTOR)
- return;
- if (d->IsPhase(PHASE_P2P))
- return;
- if (d->GetCharacter())
- d->GetCharacter()->Disconnect("Shutdown(DisconnectFunc)");
- d->SetPhase(PHASE_CLOSE);
- }
- };
- EVENTINFO(shutdown_event_data)
- {
- int seconds;
- shutdown_event_data()
- : seconds( 0 )
- {
- }
- };
- EVENTFUNC(shutdown_event)
- {
- shutdown_event_data* info = dynamic_cast<shutdown_event_data*>( event->info );
- if ( info == NULL )
- {
- sys_err( "shutdown_event> <Factor> Null pointer" );
- return 0;
- }
- int * pSec = & (info->seconds);
- if (*pSec < 0)
- {
- sys_log(0, "shutdown_event sec %d", *pSec);
- if (--*pSec == -10)
- {
- const DESC_MANAGER::DESC_SET & c_set_desc = DESC_MANAGER::instance().GetClientSet();
- std::for_each(c_set_desc.begin(), c_set_desc.end(), DisconnectFunc());
- return passes_per_sec;
- }
- else if (*pSec < -10)
- return 0;
- return passes_per_sec;
- }
- else if (*pSec == 0)
- {
- const DESC_MANAGER::DESC_SET & c_set_desc = DESC_MANAGER::instance().GetClientSet();
- std::for_each(c_set_desc.begin(), c_set_desc.end(), SendDisconnectFunc());
- g_bNoMoreClient = true;
- --*pSec;
- return passes_per_sec;
- }
- else
- {
- char buf[64];
- snprintf(buf, sizeof(buf), LC_TEXT("¼ث´ظ؟îہج %dأت ³²¾ز½ہ´د´ظ."), *pSec);
- SendNotice(buf);
- --*pSec;
- return passes_per_sec;
- }
- }
- void Shutdown(int iSec)
- {
- if (g_bNoMoreClient)
- {
- thecore_shutdown();
- return;
- }
- CWarMapManager::instance().OnShutdown();
- char buf[64];
- snprintf(buf, sizeof(buf), LC_TEXT("%dأت بؤ °شہسہج ¼ث´ظ؟î µث´د´ظ."), iSec);
- SendNotice(buf);
- shutdown_event_data* info = AllocEventInfo<shutdown_event_data>();
- info->seconds = iSec;
- event_create(shutdown_event, info, 1);
- }
- ACMD(do_shutdown)
- {
- if (NULL == ch)
- {
- sys_err("Accept shutdown command from %s.", ch->GetName());
- }
- TPacketGGShutdown p;
- p.bHeader = HEADER_GG_SHUTDOWN;
- P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown));
- Shutdown(10);
- }
- EVENTFUNC(timed_event)
- {
- TimedEventInfo * info = dynamic_cast<TimedEventInfo *>( event->info );
- if ( info == NULL )
- {
- sys_err( "timed_event> <Factor> Null pointer" );
- return 0;
- }
- LPCHARACTER ch = info->ch;
- if (ch == NULL) { // <Factor>
- return 0;
- }
- LPDESC d = ch->GetDesc();
- if (info->left_second <= 0)
- {
- ch->m_pkTimedEvent = NULL;
- switch (info->subcmd)
- {
- case SCMD_LOGOUT:
- case SCMD_QUIT:
- case SCMD_PHASE_SELECT:
- {
- TPacketNeedLoginLogInfo acc_info;
- acc_info.dwPlayerID = ch->GetDesc()->GetAccountTable().id;
- db_clientdesc->DBPacket( HEADER_GD_VALID_LOGOUT, 0, &acc_info, sizeof(acc_info) );
- LogManager::instance().DetailLoginLog( false, ch );
- }
- break;
- }
- switch (info->subcmd)
- {
- case SCMD_LOGOUT:
- if (d)
- d->SetPhase(PHASE_CLOSE);
- break;
- case SCMD_QUIT:
- ch->ChatPacket(CHAT_TYPE_COMMAND, "quit");
- break;
- case SCMD_PHASE_SELECT:
- {
- ch->Disconnect("timed_event - SCMD_PHASE_SELECT");
- if (d)
- {
- d->SetPhase(PHASE_SELECT);
- }
- }
- break;
- }
- return 0;
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%dأت ³²¾ز½ہ´د´ظ."), info->left_second);
- --info->left_second;
- }
- return PASSES_PER_SEC(1);
- }
- #ifdef ENABLE_MOVE_CHANNEL
- EVENTFUNC(change_channel_event)
- {
- ChangeChannelEventInfo * info = dynamic_cast<ChangeChannelEventInfo *>( event->info );
- if ( info == NULL )
- {
- sys_err( "change_channel_event> <Factor> Null pointer" );
- return 0;
- }
- LPCHARACTER ch = info->ch;
- if (ch == NULL) { // <Factor>
- return 0;
- }
- if (info->left_second <= 0)
- {
- ch->m_pkChangeChannelEvent = NULL;
- ch->ChangeChannel(info->channel_number);
- return 0;
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%dأت ³²¾ز½ہ´د´ظ."), info->left_second);
- --info->left_second;
- }
- return PASSES_PER_SEC(1);
- }
- #endif
- ACMD(do_cmd)
- {
- /* RECALL_DELAY
- if (ch->m_pkRecallEvent != NULL)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("أë¼ز µا¾ْ½ہ´د´ظ."));
- event_cancel(&ch->m_pkRecallEvent);
- return;
- }
- // END_OF_RECALL_DELAY */
- if (ch->m_pkTimedEvent)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("أë¼ز µا¾ْ½ہ´د´ظ."));
- event_cancel(&ch->m_pkTimedEvent);
- return;
- }
- switch (subcmd)
- {
- case SCMD_LOGOUT:
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("·خ±×ہخ ب¸éہ¸·خ µ¹¾ئ °©´د´ظ. ہل½أ¸¸ ±â´ظ¸®¼¼؟ن."));
- break;
- case SCMD_QUIT:
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°شہسہ» ء¾·ل اص´د´ظ. ہل½أ¸¸ ±â´ظ¸®¼¼؟ن."));
- break;
- case SCMD_PHASE_SELECT:
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ؤ³¸¯إح¸¦ ہüب¯ اص´د´ظ. ہل½أ¸¸ ±â´ظ¸®¼¼؟ن."));
- break;
- }
- int nExitLimitTime = 10;
- if (ch->IsHack(false, true, nExitLimitTime) &&
- false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex()) &&
- (!ch->GetWarMap() || ch->GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG))
- {
- return;
- }
- switch (subcmd)
- {
- case SCMD_LOGOUT:
- case SCMD_QUIT:
- case SCMD_PHASE_SELECT:
- {
- TimedEventInfo* info = AllocEventInfo<TimedEventInfo>();
- {
- if (ch->IsPosition(POS_FIGHTING))
- info->left_second = 10;
- else
- info->left_second = 3;
- }
- info->ch = ch;
- info->subcmd = subcmd;
- strlcpy(info->szReason, argument, sizeof(info->szReason));
- ch->m_pkTimedEvent = event_create(timed_event, info, 1);
- }
- break;
- }
- }
- ACMD(do_mount)
- {
- /*
- char arg1[256];
- struct action_mount_param param;
- // ہج¹ج إ¸°ي ہضہ¸¸é
- if (ch->GetMountingChr())
- {
- char arg2[256];
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1 || !*arg2)
- return;
- param.x = atoi(arg1);
- param.y = atoi(arg2);
- param.vid = ch->GetMountingChr()->GetVID();
- param.is_unmount = true;
- float distance = DISTANCE_SQRT(param.x - (DWORD) ch->GetX(), param.y - (DWORD) ch->GetY());
- if (distance > 600.0f)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ء» ´ُ °،±îہج °،¼ ³»¸®¼¼؟ن."));
- return;
- }
- action_enqueue(ch, ACTION_TYPE_MOUNT, ¶m, 0.0f, true);
- return;
- }
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(atoi(arg1));
- if (!tch->IsNPC() || !tch->IsMountable())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°إ±â؟،´آ إ» ¼ِ ¾ّ¾î؟ن."));
- return;
- }
- float distance = DISTANCE_SQRT(tch->GetX() - ch->GetX(), tch->GetY() - ch->GetY());
- if (distance > 600.0f)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ء» ´ُ °،±îہج °،¼ إ¸¼¼؟ن."));
- return;
- }
- param.vid = tch->GetVID();
- param.is_unmount = false;
- action_enqueue(ch, ACTION_TYPE_MOUNT, ¶m, 0.0f, true);
- */
- }
- ACMD(do_fishing)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- ch->SetRotation(atof(arg1));
- ch->fishing();
- }
- ACMD(do_console)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "ConsoleEnable");
- }
- ACMD(do_restart)
- {
- static const int iRestartHereSeconds = 170;
- static const int iRestartTownSeconds = 173;
- if (false == ch->IsDead())
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow");
- ch->StartRecoveryEvent();
- return;
- }
- if (NULL == ch->m_pkDeadEvent)
- return;
- int iTimeToDead = (event_time(ch->m_pkDeadEvent) / passes_per_sec);
- #if defined(ENABLE_COMBAT_ZONE)
- if (CCombatZoneManager::Instance().IsCombatZoneMap(ch->GetMapIndex()))
- {
- CCombatZoneManager::Instance().OnRestart(ch, subcmd);
- return;
- }
- #endif
- if (subcmd != SCMD_RESTART_TOWN && (!ch->GetWarMap() || ch->GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG))
- {
- if (!test_server)
- {
- if (ch->IsHack())
- {
- //¼؛ءِ ¸تہد°و؟ى؟،´آ أ¼إ© ادءِ ¾ت´آ´ظ.
- if (false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ئء÷ ہç½أہغ از ¼ِ ¾ّ½ہ´د´ظ. (%dأت ³²ہ½)"), iTimeToDead - (180 - g_nPortalLimitTime));
- return;
- }
- }
- if (iTimeToDead > iRestartHereSeconds)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ئء÷ ہç½أہغ از ¼ِ ¾ّ½ہ´د´ظ. (%dأت ³²ہ½)"), iTimeToDead - iRestartHereSeconds);
- return;
- }
- }
- }
- //PREVENT_HACK
- //DESC : أ¢°ي, ±³ب¯ أ¢ بؤ ئ÷إ»ہ» »ç؟ëاد´آ ¹ِ±×؟، ہج؟ëµة¼ِ ہض¾î¼
- // ؤًإ¸ہسہ» أك°،
- if (subcmd == SCMD_RESTART_TOWN)
- {
- if (ch->IsHack())
- {
- //±وµه¸ت, ¼؛ءِ¸ت؟،¼´آ أ¼إ© ادءِ ¾ت´آ´ظ.
- if ((!ch->GetWarMap() || ch->GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG) ||
- false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ئء÷ ہç½أہغ از ¼ِ ¾ّ½ہ´د´ظ. (%dأت ³²ہ½)"), iTimeToDead - (180 - g_nPortalLimitTime));
- return;
- }
- }
- if (iTimeToDead > iRestartTownSeconds)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ئء÷ ¸¶ہ»؟،¼ ہç½أہغ از ¼ِ ¾ّ½ہ´د´ظ. (%d أت ³²ہ½)"), iTimeToDead - iRestartTownSeconds);
- return;
- }
- }
- //END_PREVENT_HACK
- #ifdef ENABLE_12ZI
- if (subcmd == SCMD_RESTART_HERE)
- {
- if (ch->GetMapIndex() >= 3580000 && ch->GetMapIndex() < 3590000)
- {
- sys_log(0, "do_restart: restart here zodiac");
- BYTE Adet = ch->GetDeadCount() >= 1 ? ch->GetDeadCount()*2 : 1;
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenReviveDialog %u %u", (DWORD)ch->GetVID(), Adet);
- return;
- }
- }
- #endif
- ch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow");
- ch->GetDesc()->SetPhase(PHASE_GAME);
- ch->SetPosition(POS_STANDING);
- ch->StartRecoveryEvent();
- //FORKED_LOAD
- //DESC: »ï°إ¸® ہüإُ½أ ؛خب°ہ» از°و؟ى ¸تہا ہش±¸°، ¾ئ´ر »ï°إ¸® ہüإُہا ½أہغءِء،ہ¸·خ ہجµ؟اد°ش µب´ظ.
- if (1 == quest::CQuestManager::instance().GetEventFlag("threeway_war"))
- {
- if (subcmd == SCMD_RESTART_TOWN || subcmd == SCMD_RESTART_HERE)
- {
- #ifdef ENABLE_12ZI
- if (subcmd == SCMD_RESTART_HERE && ch->GetMapIndex() >= 3580000 && ch->GetMapIndex() < 3590000)
- {
- sys_log(0, "do_restart: restart here zodiac");
- BYTE Adet = ch->GetDeadCount() >= 1 ? ch->GetDeadCount()*2 : 1;
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenReviveDialog %u %u", (DWORD)ch->GetVID(), Adet);
- return;
- }
- #endif
- if (true == CThreeWayWar::instance().IsThreeWayWarMapIndex(ch->GetMapIndex()) &&
- false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex()))
- {
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- ch->ReviveInvisible(5);
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->PointChange(POINT_SP, ch->GetMaxSP() - ch->GetSP());
- return;
- }
- //¼؛ءِ
- if (true == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex()))
- {
- if (CThreeWayWar::instance().GetReviveTokenForPlayer(ch->GetPlayerID()) <= 0)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼؛ءِ؟،¼ ؛خب° ±âب¸¸¦ ¸ًµخ ہز¾ْ½ہ´د´ظ! ¸¶ہ»·خ ہجµ؟اص´د´ظ!"));
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- }
- else
- {
- ch->Show(ch->GetMapIndex(), GetSungziStartX(ch->GetEmpire()), GetSungziStartY(ch->GetEmpire()));
- }
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->PointChange(POINT_SP, ch->GetMaxSP() - ch->GetSP());
- ch->ReviveInvisible(5);
- return;
- }
- }
- }
- //END_FORKED_LOAD
- if (ch->GetDungeon())
- ch->GetDungeon()->UseRevive(ch);
- if (ch->GetWarMap() && !ch->IsObserverMode())
- {
- CWarMap * pMap = ch->GetWarMap();
- DWORD dwGuildOpponent = pMap ? pMap->GetGuildOpponent(ch) : 0;
- if (dwGuildOpponent)
- {
- switch (subcmd)
- {
- case SCMD_RESTART_TOWN:
- sys_log(0, "do_restart: restart town");
- PIXEL_POSITION pos;
- if (CWarMapManager::instance().GetStartPosition(ch->GetMapIndex(), ch->GetGuild()->GetID() < dwGuildOpponent ? 0 : 1, pos))
- ch->Show(ch->GetMapIndex(), pos.x, pos.y);
- else
- ch->ExitToSavedLocation();
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->PointChange(POINT_SP, ch->GetMaxSP() - ch->GetSP());
- ch->ReviveInvisible(5);
- break;
- case SCMD_RESTART_HERE:
- {
- #ifdef ENABLE_12ZI
- if (ch->GetMapIndex() >= 3580000 && ch->GetMapIndex() < 3590000)
- {
- sys_log(0, "do_restart: restart here zodiac");
- BYTE Adet = ch->GetDeadCount() >= 1 ? ch->GetDeadCount()*2 : 1;
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenReviveDialog %u %u", (DWORD)ch->GetVID(), Adet);
- return;
- }
- #endif
- sys_log(0, "do_restart: restart here");
- ch->RestartAtSamePos();
- //ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->PointChange(POINT_SP, ch->GetMaxSP() - ch->GetSP());
- ch->ReviveInvisible(5);
- }
- break;
- }
- return;
- }
- }
- switch (subcmd)
- {
- case SCMD_RESTART_TOWN:
- sys_log(0, "do_restart: restart town");
- PIXEL_POSITION pos;
- if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos))
- ch->WarpSet(pos.x, pos.y);
- else
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->DeathPenalty(1);
- break;
- case SCMD_RESTART_HERE:
- sys_log(0, "do_restart: restart here");
- ch->RestartAtSamePos();
- //ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
- ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
- ch->DeathPenalty(0);
- ch->ReviveInvisible(5);
- break;
- }
- }
- #define MAX_STAT g_iStatusPointSetMaxValue
- ACMD(do_stat_reset)
- {
- ch->PointChange(POINT_STAT_RESET_COUNT, 12 - ch->GetPoint(POINT_STAT_RESET_COUNT));
- }
- ACMD(do_stat_minus)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- if (ch->IsPolymorphed())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µذ°© ءك؟،´آ ´ة·آہ» ؟أ¸± ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (ch->GetPoint(POINT_STAT_RESET_COUNT) <= 0)
- return;
- if (!strcmp(arg1, "st"))
- {
- if (ch->GetRealPoint(POINT_ST) <= JobInitialPoints[ch->GetJob()].st)
- return;
- ch->SetRealPoint(POINT_ST, ch->GetRealPoint(POINT_ST) - 1);
- ch->SetPoint(POINT_ST, ch->GetPoint(POINT_ST) - 1);
- ch->ComputePoints();
- ch->PointChange(POINT_ST, 0);
- }
- else if (!strcmp(arg1, "dx"))
- {
- if (ch->GetRealPoint(POINT_DX) <= JobInitialPoints[ch->GetJob()].dx)
- return;
- ch->SetRealPoint(POINT_DX, ch->GetRealPoint(POINT_DX) - 1);
- ch->SetPoint(POINT_DX, ch->GetPoint(POINT_DX) - 1);
- ch->ComputePoints();
- ch->PointChange(POINT_DX, 0);
- }
- else if (!strcmp(arg1, "ht"))
- {
- if (ch->GetRealPoint(POINT_HT) <= JobInitialPoints[ch->GetJob()].ht)
- return;
- ch->SetRealPoint(POINT_HT, ch->GetRealPoint(POINT_HT) - 1);
- ch->SetPoint(POINT_HT, ch->GetPoint(POINT_HT) - 1);
- ch->ComputePoints();
- ch->PointChange(POINT_HT, 0);
- ch->PointChange(POINT_MAX_HP, 0);
- }
- else if (!strcmp(arg1, "iq"))
- {
- if (ch->GetRealPoint(POINT_IQ) <= JobInitialPoints[ch->GetJob()].iq)
- return;
- ch->SetRealPoint(POINT_IQ, ch->GetRealPoint(POINT_IQ) - 1);
- ch->SetPoint(POINT_IQ, ch->GetPoint(POINT_IQ) - 1);
- ch->ComputePoints();
- ch->PointChange(POINT_IQ, 0);
- ch->PointChange(POINT_MAX_SP, 0);
- }
- else
- return;
- ch->PointChange(POINT_STAT, +1);
- ch->PointChange(POINT_STAT_RESET_COUNT, -1);
- ch->ComputePoints();
- }
- ACMD(do_stat)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- if (ch->IsPolymorphed())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µذ°© ءك؟،´آ ´ة·آہ» ؟أ¸± ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (ch->GetPoint(POINT_STAT) <= 0)
- return;
- BYTE idx = 0;
- if (!strcmp(arg1, "st"))
- idx = POINT_ST;
- else if (!strcmp(arg1, "dx"))
- idx = POINT_DX;
- else if (!strcmp(arg1, "ht"))
- idx = POINT_HT;
- else if (!strcmp(arg1, "iq"))
- idx = POINT_IQ;
- else
- return;
- // ch->ChatPacket(CHAT_TYPE_INFO, "%s GRP(%d) idx(%u), MAX_STAT(%d), expr(%d)", __FUNCTION__, ch->GetRealPoint(idx), idx, MAX_STAT, ch->GetRealPoint(idx) >= MAX_STAT);
- if (ch->GetRealPoint(idx) >= MAX_STAT)
- return;
- ch->SetRealPoint(idx, ch->GetRealPoint(idx) + 1);
- ch->SetPoint(idx, ch->GetPoint(idx) + 1);
- ch->ComputePoints();
- ch->PointChange(idx, 0);
- if (idx == POINT_IQ)
- {
- ch->PointChange(POINT_MAX_HP, 0);
- }
- else if (idx == POINT_HT)
- {
- ch->PointChange(POINT_MAX_SP, 0);
- }
- ch->PointChange(POINT_STAT, -1);
- ch->ComputePoints();
- }
- ACMD(do_pvp)
- {
- #if defined(ENABLE_COMBAT_ZONE)
- if (CCombatZoneManager::Instance().IsCombatZoneMap(ch->GetMapIndex()))
- return;
- #endif
- if (ch->GetArena() != NULL || CArenaManager::instance().IsArenaMap(ch->GetMapIndex()) == true)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·أہه؟،¼ »ç؟ëاد½ا ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER pkVictim = CHARACTER_MANAGER::instance().Find(vid);
- if (!pkVictim)
- return;
- if (pkVictim->IsNPC())
- return;
- if (pkVictim->GetArena() != NULL)
- {
- pkVictim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»َ´ë¹وہج ´ë·أءكہش´د´ظ."));
- return;
- }
- CPVPManager::instance().Insert(ch, pkVictim);
- }
- ACMD(do_guildskillup)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- if (!ch->GetGuild())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±وµه؟، ¼ساطہضءِ ¾ت½ہ´د´ظ."));
- return;
- }
- CGuild* g = ch->GetGuild();
- TGuildMember* gm = g->GetMember(ch->GetPlayerID());
- if (gm->grade == GUILD_LEADER_GRADE)
- {
- DWORD vnum = 0;
- str_to_number(vnum, arg1);
- g->SkillLevelUp(vnum);
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±وµه ½؛إ³ ·¹؛§ہ» ؛¯°واز ±اارہج ¾ّ½ہ´د´ظ."));
- }
- }
- ACMD(do_skillup)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD vnum = 0;
- str_to_number(vnum, arg1);
- if (true == ch->CanUseSkill(vnum))
- {
- ch->SkillLevelUp(vnum);
- }
- else
- {
- switch(vnum)
- {
- case SKILL_HORSE_WILDATTACK:
- case SKILL_HORSE_CHARGE:
- case SKILL_HORSE_ESCAPE:
- case SKILL_HORSE_WILDATTACK_RANGE:
- case SKILL_7_A_ANTI_TANHWAN:
- case SKILL_7_B_ANTI_AMSEOP:
- case SKILL_7_C_ANTI_SWAERYUNG:
- case SKILL_7_D_ANTI_YONGBI:
- case SKILL_8_A_ANTI_GIGONGCHAM:
- case SKILL_8_B_ANTI_YEONSA:
- case SKILL_8_C_ANTI_MAHWAN:
- case SKILL_8_D_ANTI_BYEURAK:
- case SKILL_ADD_HP:
- case SKILL_RESIST_PENETRATE:
- #ifdef ENABLE_78TH_SKILL
- case SKILL_ANTI_PALBANG:
- case SKILL_ANTI_AMSEOP:
- case SKILL_ANTI_SWAERYUNG:
- case SKILL_ANTI_YONGBI:
- case SKILL_ANTI_GIGONGCHAM:
- case SKILL_ANTI_HWAJO:
- case SKILL_ANTI_MARYUNG:
- case SKILL_ANTI_BYEURAK:
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case SKILL_ANTI_SALPOONG:
- #endif
- case SKILL_HELP_PALBANG:
- case SKILL_HELP_AMSEOP:
- case SKILL_HELP_SWAERYUNG:
- case SKILL_HELP_YONGBI:
- case SKILL_HELP_GIGONGCHAM:
- case SKILL_HELP_HWAJO:
- case SKILL_HELP_MARYUNG:
- case SKILL_HELP_BYEURAK:
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case SKILL_HELP_SALPOONG:
- #endif
- #endif
- ch->SkillLevelUp(vnum);
- break;
- }
- }
- }
- //
- // @version 05/06/20 Bang2ni - ؤ؟¸اµه أ³¸® Delegate to CHARACTER class
- //
- ACMD(do_safebox_close)
- {
- ch->CloseSafebox();
- }
- //
- // @version 05/06/20 Bang2ni - ؤ؟¸اµه أ³¸® Delegate to CHARACTER class
- //
- ACMD(do_safebox_password)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- ch->ReqSafeboxLoad(arg1);
- }
- ACMD(do_safebox_change_password)
- {
- char arg1[256];
- char arg2[256];
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1 || strlen(arg1)>6)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<أ¢°ي> ہك¸ّµب ¾دب£¸¦ ہش·آاد¼ج½ہ´د´ظ."));
- return;
- }
- if (!*arg2 || strlen(arg2)>6)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<أ¢°ي> ہك¸ّµب ¾دب£¸¦ ہش·آاد¼ج½ہ´د´ظ."));
- return;
- }
- TSafeboxChangePasswordPacket p;
- p.dwID = ch->GetDesc()->GetAccountTable().id;
- strlcpy(p.szOldPassword, arg1, sizeof(p.szOldPassword));
- strlcpy(p.szNewPassword, arg2, sizeof(p.szNewPassword));
- db_clientdesc->DBPacket(HEADER_GD_SAFEBOX_CHANGE_PASSWORD, ch->GetDesc()->GetHandle(), &p, sizeof(p));
- }
- ACMD(do_mall_password)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1 || strlen(arg1) > 6)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<أ¢°ي> ہك¸ّµب ¾دب£¸¦ ہش·آاد¼ج½ہ´د´ظ."));
- return;
- }
- int iPulse = thecore_pulse();
- if (ch->GetMall())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<أ¢°ي> أ¢°ي°، ہج¹ج ؟·ءہض½ہ´د´ظ."));
- return;
- }
- if (iPulse - ch->GetMallLoadTime() < passes_per_sec * 10) // 10أت؟، ار¹ّ¸¸ ؟نأ» °،´ة
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<أ¢°ي> أ¢°ي¸¦ ´فہ؛ءِ 10أت ¾ب؟،´آ ؟ ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- ch->SetMallLoadTime(iPulse);
- TSafeboxLoadPacket p;
- p.dwID = ch->GetDesc()->GetAccountTable().id;
- strlcpy(p.szLogin, ch->GetDesc()->GetAccountTable().login, sizeof(p.szLogin));
- strlcpy(p.szPassword, arg1, sizeof(p.szPassword));
- db_clientdesc->DBPacket(HEADER_GD_MALL_LOAD, ch->GetDesc()->GetHandle(), &p, sizeof(p));
- }
- ACMD(do_mall_close)
- {
- if (ch->GetMall())
- {
- ch->SetMallLoadTime(thecore_pulse());
- ch->CloseMall();
- ch->Save();
- }
- }
- ACMD(do_ungroup)
- {
- if (!ch->GetParty())
- return;
- if (!CPartyManager::instance().IsEnablePCParty())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ئؤئ¼> ¼¹ِ ¹®ء¦·خ ئؤئ¼ °ü·أ أ³¸®¸¦ از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (ch->GetDungeon())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ئؤئ¼> ´ّہü ¾ب؟،¼´آ ئؤئ¼؟،¼ ³ھ°¥ ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- #ifdef ENABLE_12ZI
- if (ch->GetZodiac())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't break the group in the zodiac temple."));
- return;
- }
- if (ch->GetMapIndex() >= 3580000 && ch->GetMapIndex() < 3590000)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't break the group in the zodiac temple."));
- return;
- }
- #endif
- LPPARTY pParty = ch->GetParty();
- if (pParty->GetMemberCount() == 2)
- {
- // party disband
- CPartyManager::instance().DeleteParty(pParty);
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ئؤئ¼> ئؤئ¼؟،¼ ³ھ°،¼ج½ہ´د´ظ."));
- //pParty->SendPartyRemoveOneToAll(ch);
- pParty->Quit(ch->GetPlayerID());
- //pParty->SendPartyRemoveAllToOne(ch);
- }
- }
- ACMD(do_close_shop)
- {
- if (ch->GetMyShop())
- {
- ch->CloseMyShop();
- return;
- }
- }
- ACMD(do_set_walk_mode)
- {
- ch->SetNowWalking(true);
- ch->SetWalking(true);
- }
- ACMD(do_set_run_mode)
- {
- ch->SetNowWalking(false);
- ch->SetWalking(false);
- }
- ACMD(do_war)
- {
- //³» ±وµه ء¤؛¸¸¦ ¾ٍ¾î؟ہ°ي
- CGuild * g = ch->GetGuild();
- if (!g)
- return;
- //ہüہïءكہخءِ أ¼إ©ار¹ّ!
- if (g->UnderAnyWar())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ہج¹ج ´ظ¸¥ ہüہï؟، آüہü ءك ہش´د´ظ."));
- return;
- }
- //ئؤ¶َ¸قإح¸¦ µخ¹è·خ ³ھ´©°ي
- char arg1[256], arg2[256];
- DWORD type = GUILD_WAR_TYPE_FIELD; //fixme102 base int modded uint
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1)
- return;
- if (*arg2)
- {
- str_to_number(type, arg2);
- if (type >= GUILD_WAR_TYPE_MAX_NUM)
- type = GUILD_WAR_TYPE_FIELD;
- }
- //±وµهہا ¸¶½؛إح ¾ئہجµً¸¦ ¾ٍ¾î؟آµع
- DWORD gm_pid = g->GetMasterPID();
- //¸¶½؛إحہخءِ أ¼إ©(±وہüہ؛ ±وµهہه¸¸ہج °،´ة)
- if (gm_pid != ch->GetPlayerID())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±وµهہü؟، ´ëار ±اارہج ¾ّ½ہ´د´ظ."));
- return;
- }
- //»َ´ë ±وµه¸¦ ¾ٍ¾î؟ہ°ي
- CGuild * opp_g = CGuildManager::instance().FindGuildByName(arg1);
- if (!opp_g)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±×·± ±وµه°، ¾ّ½ہ´د´ظ."));
- return;
- }
- //»َ´ë±وµه؟حہا »َإآ أ¼إ©
- switch (g->GetGuildWarState(opp_g->GetID()))
- {
- case GUILD_WAR_NONE:
- {
- if (opp_g->UnderAnyWar())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµه°، ہج¹ج ہüہï ءك ہش´د´ظ."));
- return;
- }
- int iWarPrice = KOR_aGuildWarInfo[type].iWarPrice;
- if (g->GetGuildMoney() < iWarPrice)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ہü؛ٌ°، ؛خء·اد؟© ±وµهہüہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (opp_g->GetGuildMoney() < iWarPrice)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµهہا ہü؛ٌ°، ؛خء·اد؟© ±وµهہüہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- }
- break;
- case GUILD_WAR_SEND_DECLARE:
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہج¹ج ¼±ہüئ÷°ي ءكہخ ±وµهہش´د´ظ."));
- return;
- }
- break;
- case GUILD_WAR_RECV_DECLARE:
- {
- if (opp_g->UnderAnyWar())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµه°، ہج¹ج ہüہï ءك ہش´د´ظ."));
- g->RequestRefuseWar(opp_g->GetID());
- return;
- }
- }
- break;
- case GUILD_WAR_RESERVE:
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ہج¹ج ہüہïہج ؟¹¾àµب ±وµه ہش´د´ظ."));
- return;
- }
- break;
- case GUILD_WAR_END:
- return;
- default:
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ہج¹ج ہüہï ءكہخ ±وµهہش´د´ظ."));
- g->RequestRefuseWar(opp_g->GetID());
- return;
- }
- if (!g->CanStartWar(type))
- {
- // ±وµهہüہ» از ¼ِ ہض´آ ء¶°اہ» ¸¸ء·ادءِ¾ت´آ´ظ.
- if (g->GetLadderPoint() == 0)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ·¹´ُ ء،¼ِ°، ¸ًہع¶َ¼ ±وµهہüہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- sys_log(0, "GuildWar.StartError.NEED_LADDER_POINT");
- }
- else if (g->GetMemberCount() < GUILD_WAR_MIN_MEMBER_COUNT)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±وµهہüہ» اد±â ہ§اط¼± أض¼زار %d¸يہج ہض¾î¾ك اص´د´ظ."), GUILD_WAR_MIN_MEMBER_COUNT);
- sys_log(0, "GuildWar.StartError.NEED_MINIMUM_MEMBER[%d]", GUILD_WAR_MIN_MEMBER_COUNT);
- }
- else
- {
- sys_log(0, "GuildWar.StartError.UNKNOWN_ERROR");
- }
- return;
- }
- // اتµهہü أ¼إ©¸¸ اد°ي ¼¼¼¼ار أ¼إ©´آ »َ´ë¹وہج ½آ³«از¶§ ار´ظ.
- if (!opp_g->CanStartWar(GUILD_WAR_TYPE_FIELD))
- {
- if (opp_g->GetLadderPoint() == 0)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµهہا ·¹´ُ ء،¼ِ°، ¸ًہع¶َ¼ ±وµهہüہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- else if (opp_g->GetMemberCount() < GUILD_WAR_MIN_MEMBER_COUNT)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµهہا ±وµه؟ّ ¼ِ°، ؛خء·اد؟© ±وµهہüہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- do
- {
- if (g->GetMasterCharacter() != NULL)
- break;
- CCI *pCCI = P2P_MANAGER::instance().FindByPID(g->GetMasterPID());
- if (pCCI != NULL)
- break;
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµهہا ±وµهہهہج ء¢¼سءكہج ¾ئ´ص´د´ظ."));
- g->RequestRefuseWar(opp_g->GetID());
- return;
- } while (false);
- do
- {
- if (opp_g->GetMasterCharacter() != NULL)
- break;
- CCI *pCCI = P2P_MANAGER::instance().FindByPID(opp_g->GetMasterPID());
- if (pCCI != NULL)
- break;
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> »َ´ë¹و ±وµهہا ±وµهہهہج ء¢¼سءكہج ¾ئ´ص´د´ظ."));
- g->RequestRefuseWar(opp_g->GetID());
- return;
- } while (false);
- g->RequestDeclareWar(opp_g->GetID(), type);
- }
- ACMD(do_nowar)
- {
- CGuild* g = ch->GetGuild();
- if (!g)
- return;
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD gm_pid = g->GetMasterPID();
- if (gm_pid != ch->GetPlayerID())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±وµهہü؟، ´ëار ±اارہج ¾ّ½ہ´د´ظ."));
- return;
- }
- CGuild* opp_g = CGuildManager::instance().FindGuildByName(arg1);
- if (!opp_g)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<±وµه> ±×·± ±وµه°، ¾ّ½ہ´د´ظ."));
- return;
- }
- g->RequestRefuseWar(opp_g->GetID());
- }
- ACMD(do_detaillog)
- {
- ch->DetailLog();
- }
- ACMD(do_monsterlog)
- {
- ch->ToggleMonsterLog();
- }
- ACMD(do_pkmode)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- BYTE mode = 0;
- str_to_number(mode, arg1);
- if (mode == PK_MODE_PROTECT)
- return;
- if (ch->GetLevel() < PK_PROTECT_LEVEL && mode != 0)
- return;
- #if defined(ENABLE_COMBAT_ZONE)
- if (CCombatZoneManager::Instance().IsCombatZoneMap(ch->GetMapIndex()))
- return;
- #endif
- ch->SetPKMode(mode);
- }
- ACMD(do_messenger_auth)
- {
- if (ch->GetArena())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·أہه؟،¼ »ç؟ëاد½ا ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- char arg1[256], arg2[256];
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1 || !*arg2)
- return;
- char answer = LOWER(*arg1);
- // @fixme130 AuthToAdd void -> bool
- bool bIsDenied = answer != 'y';
- bool bIsAdded = MessengerManager::instance().AuthToAdd(ch->GetName(), arg2, bIsDenied); // DENY
- if (bIsAdded && bIsDenied)
- {
- LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg2);
- if (tch)
- tch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´شہ¸·خ ؛خإح ؤ£±¸ µî·دہ» °إ؛خ ´çاك½ہ´د´ظ."), ch->GetName());
- }
- }
- ACMD(do_setblockmode)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (*arg1)
- {
- BYTE flag = 0;
- str_to_number(flag, arg1);
- ch->SetBlockMode(flag);
- }
- }
- ACMD(do_unmount)
- {
- if (true == ch->UnEquipSpecialRideUniqueItem())
- {
- ch->RemoveAffect(AFFECT_MOUNT);
- ch->RemoveAffect(AFFECT_MOUNT_BONUS);
- if (ch->IsHorseRiding())
- {
- ch->StopRiding();
- }
- }
- else
- {
- ch->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("ہخ؛¥إن¸®°، ²ث آ÷¼ ³»¸± ¼ِ ¾ّ½ہ´د´ظ."));
- }
- }
- ACMD(do_observer_exit)
- {
- if (ch->IsObserverMode())
- {
- if (ch->GetWarMap())
- ch->SetWarMap(NULL);
- if (ch->GetArena() != NULL || ch->GetArenaObserverMode() == true)
- {
- ch->SetArenaObserverMode(false);
- if (ch->GetArena() != NULL)
- ch->GetArena()->RemoveObserver(ch->GetPlayerID());
- ch->SetArena(NULL);
- ch->WarpSet(ARENA_RETURN_POINT_X(ch->GetEmpire()), ARENA_RETURN_POINT_Y(ch->GetEmpire()));
- }
- else
- {
- ch->ExitToSavedLocation();
- }
- ch->SetObserverMode(false);
- }
- }
- ACMD(do_view_equip)
- {
- //if (ch->GetGMLevel() <= GM_PLAYER)
- //return;
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (*arg1)
- {
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (!tch)
- return;
- if (!tch->IsPC())
- return;
- /*
- int iSPCost = ch->GetMaxSP() / 3;
- if (ch->GetSP() < iSPCost)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ء¤½إ·آہج ؛خء·اد؟© ´ظ¸¥ »ç¶÷ہا ہه؛ٌ¸¦ ؛¼ ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- ch->PointChange(POINT_SP, -iSPCost);
- */
- tch->SendEquipment(ch);
- }
- }
- ACMD(do_party_request)
- {
- if (ch->GetArena())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·أہه؟،¼ »ç؟ëاد½ا ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (ch->GetParty())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہج¹ج ئؤئ¼؟، ¼ساط ہضہ¸¹ا·خ °،ہش½إأ»ہ» از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (tch)
- if (!ch->RequestToParty(tch))
- ch->ChatPacket(CHAT_TYPE_COMMAND, "PartyRequestDenied");
- }
- ACMD(do_party_request_accept)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (tch)
- ch->AcceptToParty(tch);
- }
- ACMD(do_party_request_deny)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (tch)
- ch->DenyToParty(tch);
- }
- ACMD(do_monarch_warpto)
- {
- if (!CMonarch::instance().IsMonarch(ch->GetPlayerID(), ch->GetEmpire()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±؛ءض¸¸ہج »ç؟ë °،´ةار ±â´ةہش´د´ظ"));
- return;
- }
- //±؛ءض ؤًإ¸ہس °ث»ç
- if (!ch->IsMCOK(CHARACTER::MI_WARP))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%d أت°£ ؤًإ¸ہسہج ہû؟ëءكہش´د´ظ."), ch->GetMCLTime(CHARACTER::MI_WARP));
- return;
- }
- //±؛ءض ¸÷ ¼زب¯ ؛ٌ؟ë
- const int WarpPrice = 10000;
- //±؛ءض ±¹°ي °ث»ç
- if (!CMonarch::instance().IsMoneyOk(WarpPrice, ch->GetEmpire()))
- {
- int NationMoney = CMonarch::instance().GetMoney(ch->GetEmpire());
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±¹°ي؟، µ·ہج ؛خء·اص´د´ظ. اِہç : %u ات؟ن±ف¾× : %u"), NationMoney, WarpPrice);
- return;
- }
- int x = 0, y = 0;
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ç؟ë¹: warpto <character name>"));
- return;
- }
- LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
- if (!tch)
- {
- CCI * pkCCI = P2P_MANAGER::instance().Find(arg1);
- if (pkCCI)
- {
- if (pkCCI->bEmpire != ch->GetEmpire())
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("إ¸ء¦±¹ ہ¯ہْ؟،°ش´آ ہجµ؟از¼ِ ¾ّ½ہ´د´ظ"));
- return;
- }
- if (pkCCI->bChannel != g_bChannel)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("اط´ç ہ¯ہْ´آ %d أ¤³خ؟، ہض½ہ´د´ظ. (اِہç أ¤³خ %d)"), pkCCI->bChannel, g_bChannel);
- return;
- }
- if (!IsMonarchWarpZone(pkCCI->lMapIndex))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ہجµ؟از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- PIXEL_POSITION pos;
- if (!SECTREE_MANAGER::instance().GetCenterPositionOfMap(pkCCI->lMapIndex, pos))
- ch->ChatPacket(CHAT_TYPE_INFO, "Cannot find map (index %d)", pkCCI->lMapIndex);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You warp to (%d, %d)", pos.x, pos.y);
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ؟،°ش·خ ہجµ؟اص´د´ظ"), arg1);
- ch->WarpSet(pos.x, pos.y);
- //±؛ءض µ· »è°¨
- CMonarch::instance().SendtoDBDecMoney(WarpPrice, ch->GetEmpire(), ch);
- //ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_WARP);
- }
- }
- else if (NULL == CHARACTER_MANAGER::instance().FindPC(arg1))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "There is no one by that name");
- }
- return;
- }
- else
- {
- if (tch->GetEmpire() != ch->GetEmpire())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("إ¸ء¦±¹ ہ¯ہْ؟،°ش´آ ہجµ؟از¼ِ ¾ّ½ہ´د´ظ"));
- return;
- }
- if (!IsMonarchWarpZone(tch->GetMapIndex()))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ہجµ؟از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- x = tch->GetX();
- y = tch->GetY();
- }
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ؟،°ش·خ ہجµ؟اص´د´ظ"), arg1);
- ch->WarpSet(x, y);
- ch->Stop();
- //±؛ءض µ· »è°¨
- CMonarch::instance().SendtoDBDecMoney(WarpPrice, ch->GetEmpire(), ch);
- //ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_WARP);
- }
- ACMD(do_monarch_transfer)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ç؟ë¹: transfer <name>"));
- return;
- }
- if (!CMonarch::instance().IsMonarch(ch->GetPlayerID(), ch->GetEmpire()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±؛ءض¸¸ہج »ç؟ë °،´ةار ±â´ةہش´د´ظ"));
- return;
- }
- //±؛ءض ؤًإ¸ہس °ث»ç
- if (!ch->IsMCOK(CHARACTER::MI_TRANSFER))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%d أت°£ ؤًإ¸ہسہج ہû؟ëءكہش´د´ظ."), ch->GetMCLTime(CHARACTER::MI_TRANSFER));
- return;
- }
- //±؛ءض ؟ِاء ؛ٌ؟ë
- const int WarpPrice = 10000;
- //±؛ءض ±¹°ي °ث»ç
- if (!CMonarch::instance().IsMoneyOk(WarpPrice, ch->GetEmpire()))
- {
- int NationMoney = CMonarch::instance().GetMoney(ch->GetEmpire());
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±¹°ي؟، µ·ہج ؛خء·اص´د´ظ. اِہç : %u ات؟ن±ف¾× : %u"), NationMoney, WarpPrice);
- return;
- }
- LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
- if (!tch)
- {
- CCI * pkCCI = P2P_MANAGER::instance().Find(arg1);
- if (pkCCI)
- {
- if (pkCCI->bEmpire != ch->GetEmpire())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ظ¸¥ ء¦±¹ ہ¯ہْ´آ ¼زب¯از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (pkCCI->bChannel != g_bChannel)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´شہ؛ %d أ¤³خ؟، ء¢¼س ءك ہش´د´ظ. (اِہç أ¤³خ: %d)"), arg1, pkCCI->bChannel, g_bChannel);
- return;
- }
- if (!IsMonarchWarpZone(pkCCI->lMapIndex))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ہجµ؟از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (!IsMonarchWarpZone(ch->GetMapIndex()))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ¼زب¯از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- TPacketGGTransfer pgg;
- pgg.bHeader = HEADER_GG_TRANSFER;
- strlcpy(pgg.szName, arg1, sizeof(pgg.szName));
- pgg.lX = ch->GetX();
- pgg.lY = ch->GetY();
- P2P_MANAGER::instance().Send(&pgg, sizeof(TPacketGGTransfer));
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´شہ» ¼زب¯اد؟´½ہ´د´ظ."), arg1);
- //±؛ءض µ· »è°¨
- CMonarch::instance().SendtoDBDecMoney(WarpPrice, ch->GetEmpire(), ch);
- //ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_TRANSFER);
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہش·آاد½إ ہج¸§ہ» °،ءّ »ç؟ëہع°، ¾ّ½ہ´د´ظ."));
- }
- return;
- }
- if (ch == tch)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہع½إہ» ¼زب¯از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (tch->GetEmpire() != ch->GetEmpire())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ظ¸¥ ء¦±¹ ہ¯ہْ´آ ¼زب¯از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (!IsMonarchWarpZone(tch->GetMapIndex()))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ہجµ؟از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- if (!IsMonarchWarpZone(ch->GetMapIndex()))
- {
- ch->ChatPacket (CHAT_TYPE_INFO, LC_TEXT("اط´ç ءِ؟ھہ¸·خ ¼زب¯از ¼ِ ¾ّ½ہ´د´ظ."));
- return;
- }
- //tch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
- tch->WarpSet(ch->GetX(), ch->GetY(), ch->GetMapIndex());
- //±؛ءض µ· »è°¨
- CMonarch::instance().SendtoDBDecMoney(WarpPrice, ch->GetEmpire(), ch);
- //ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_TRANSFER);
- }
- ACMD(do_monarch_info)
- {
- if (CMonarch::instance().IsMonarch(ch->GetPlayerID(), ch->GetEmpire()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("³ھہا ±؛ءض ء¤؛¸"));
- TMonarchInfo * p = CMonarch::instance().GetMonarch();
- for (int n = 1; n < 4; ++n)
- {
- if (n == ch->GetEmpire())
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[%s±؛ءض] : %s ؛¸ہ¯±ف¾× %lld "), EMPIRE_NAME(n), p->name[n], p->money[n]);
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[%s±؛ءض] : %s "), EMPIRE_NAME(n), p->name[n]);
- }
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±؛ءض ء¤؛¸"));
- TMonarchInfo * p = CMonarch::instance().GetMonarch();
- for (int n = 1; n < 4; ++n)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[%s±؛ءض] : %s "), EMPIRE_NAME(n), p->name[n]);
- }
- }
- }
- ACMD(do_elect)
- {
- db_clientdesc->DBPacketHeader(HEADER_GD_COME_TO_VOTE, ch->GetDesc()->GetHandle(), 0);
- }
- // LUA_ADD_GOTO_INFO
- struct GotoInfo
- {
- std::string st_name;
- BYTE empire;
- int mapIndex;
- DWORD x, y;
- GotoInfo()
- {
- st_name = "";
- empire = 0;
- mapIndex = 0;
- x = 0;
- y = 0;
- }
- GotoInfo(const GotoInfo& c_src)
- {
- __copy__(c_src);
- }
- void operator = (const GotoInfo& c_src)
- {
- __copy__(c_src);
- }
- void __copy__(const GotoInfo& c_src)
- {
- st_name = c_src.st_name;
- empire = c_src.empire;
- mapIndex = c_src.mapIndex;
- x = c_src.x;
- y = c_src.y;
- }
- };
- ACMD(do_monarch_tax)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Usage: monarch_tax <1-50>");
- return;
- }
- // ±؛ءض °ث»ç
- if (!ch->IsMonarch())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±؛ءض¸¸ہج »ç؟ëاز¼ِ ہض´آ ±â´ةہش´د´ظ"));
- return;
- }
- // ¼¼±ف¼³ء¤
- int tax = 0;
- str_to_number(tax, arg1);
- if (tax < 1 || tax > 50)
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("1-50 »çہجہا ¼ِؤ،¸¦ ¼±إأاطءض¼¼؟ن"));
- quest::CQuestManager::instance().SetEventFlag("trade_tax", tax);
- // ±؛ءض؟،°ش ¸ق¼¼ءِ اد³ھ
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼¼±فہج %d %·خ ¼³ء¤µا¾ْ½ہ´د´ظ"));
- // °ّءِ
- char szMsg[1024];
- snprintf(szMsg, sizeof(szMsg), "±؛ءضہا ¸يہ¸·خ ¼¼±فہج %d %% ·خ ؛¯°وµا¾ْ½ہ´د´ظ", tax);
- BroadcastNotice(szMsg);
- snprintf(szMsg, sizeof(szMsg), "¾صہ¸·خ´آ °إ·، ±ف¾×ہا %d %% °، ±¹°ي·خ µé¾î°،°شµث´د´ظ.", tax);
- BroadcastNotice(szMsg);
- // ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_TAX);
- }
- static const DWORD cs_dwMonarchMobVnums[] =
- {
- 191, // »ê°ك½إ
- 192, // ہْ½إ
- 193, // ؟ُ½إ
- 194, // ب£½إ
- 391, // ¹جء¤
- 392, // ہ؛ء¤
- 393, // ¼¼¶û
- 394, // ءّبٌ
- 491, // ¸حب¯
- 492, // ؛¸؟ى
- 493, // ±¸ئذ
- 494, // أكبç
- 591, // ؛ٌ·ù´ـ´ëہه
- 691, // ؟ُ±ح ء·ہه
- 791, // ¹ذ±³±³ءض
- 1304, // ´©··¹ü±ح
- 1901, // ±¸¹جب£
- 2091, // ؟©؟ص°إ¹ج
- 2191, // °إ´ë»ç¸·°إ؛د
- 2206, // ب؟°؟صi
- 0,
- };
- ACMD(do_monarch_mob)
- {
- char arg1[256];
- LPCHARACTER tch;
- one_argument(argument, arg1, sizeof(arg1));
- if (!ch->IsMonarch())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±؛ءض¸¸ہج »ç؟ëاز¼ِ ہض´آ ±â´ةہش´د´ظ"));
- return;
- }
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Usage: mmob <mob name>");
- return;
- }
- #ifdef ENABLE_MONARCH_MOB_CMD_MAP_CHECK // @warme006
- BYTE pcEmpire = ch->GetEmpire();
- BYTE mapEmpire = SECTREE_MANAGER::instance().GetEmpireFromMapIndex(ch->GetMapIndex());
- if (mapEmpire != pcEmpire && mapEmpire != 0)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ہع±¹ ؟µإن؟،¼¸¸ »ç؟ëاز ¼ِ ہض´آ ±â´ةہش´د´ظ"));
- return;
- }
- #endif
- // ±؛ءض ¸÷ ¼زب¯ ؛ٌ؟ë
- const int SummonPrice = 5000000;
- // ±؛ءض ؤًإ¸ہس °ث»ç
- if (!ch->IsMCOK(CHARACTER::MI_SUMMON))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%d أت°£ ؤًإ¸ہسہج ہû؟ëءكہش´د´ظ."), ch->GetMCLTime(CHARACTER::MI_SUMMON));
- return;
- }
- // ±؛ءض ±¹°ي °ث»ç
- if (!CMonarch::instance().IsMoneyOk(SummonPrice, ch->GetEmpire()))
- {
- int NationMoney = CMonarch::instance().GetMoney(ch->GetEmpire());
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("±¹°ي؟، µ·ہج ؛خء·اص´د´ظ. اِہç : %u ات؟ن±ف¾× : %u"), NationMoney, SummonPrice);
- return;
- }
- const CMob * pkMob;
- DWORD vnum = 0;
- if (isdigit(*arg1))
- {
- str_to_number(vnum, arg1);
- if ((pkMob = CMobManager::instance().Get(vnum)) == NULL)
- vnum = 0;
- }
- else
- {
- pkMob = CMobManager::Instance().Get(arg1, true);
- if (pkMob)
- vnum = pkMob->m_table.dwVnum;
- }
- DWORD count;
- // ¼زب¯ °،´ة ¸÷ °ث»ç
- for (count = 0; cs_dwMonarchMobVnums[count] != 0; ++count)
- if (cs_dwMonarchMobVnums[count] == vnum)
- break;
- if (0 == cs_dwMonarchMobVnums[count])
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼زب¯از¼ِ ¾ّ´آ ¸َ½؛إح ہش´د´ظ. ¼زب¯°،´ةار ¸َ½؛إح´آ ب¨ئنہجءِ¸¦ آüء¶اد¼¼؟ن"));
- return;
- }
- tch = CHARACTER_MANAGER::instance().SpawnMobRange(vnum,
- ch->GetMapIndex(),
- ch->GetX() - number(200, 750),
- ch->GetY() - number(200, 750),
- ch->GetX() + number(200, 750),
- ch->GetY() + number(200, 750),
- true,
- pkMob->m_table.bType == CHAR_TYPE_STONE,
- true);
- if (tch)
- {
- // ±؛ءض µ· »è°¨
- CMonarch::instance().SendtoDBDecMoney(SummonPrice, ch->GetEmpire(), ch);
- // ؤًإ¸ہس أت±âب
- ch->SetMC(CHARACTER::MI_SUMMON);
- }
- }
- static const char* FN_point_string(int apply_number)
- {
- switch (apply_number)
- {
- case POINT_MAX_HP: return LC_TEXT("أض´ë »¸ي·آ +%d");
- case POINT_MAX_SP: return LC_TEXT("أض´ë ء¤½إ·آ +%d");
- case POINT_HT: return LC_TEXT("أ¼·آ +%d");
- case POINT_IQ: return LC_TEXT("ءِ´ة +%d");
- case POINT_ST: return LC_TEXT("±ظ·آ +%d");
- case POINT_DX: return LC_TEXT("¹خأ¸ +%d");
- case POINT_ATT_SPEED: return LC_TEXT("°ّ°ف¼سµµ +%d");
- case POINT_MOV_SPEED: return LC_TEXT("ہجµ؟¼سµµ %d");
- case POINT_CASTING_SPEED: return LC_TEXT("ؤًإ¸ہس -%d");
- case POINT_HP_REGEN: return LC_TEXT("»¸ي·آ ب¸؛¹ +%d");
- case POINT_SP_REGEN: return LC_TEXT("ء¤½إ·آ ب¸؛¹ +%d");
- case POINT_POISON_PCT: return LC_TEXT("µ¶°ّ°ف %d");
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case POINT_BLEEDING_PCT: return LC_TEXT("µ¶°ّ°ف %d");
- #endif
- case POINT_STUN_PCT: return LC_TEXT("½؛إد +%d");
- case POINT_SLOW_PCT: return LC_TEXT("½½·خ؟ى +%d");
- case POINT_CRITICAL_PCT: return LC_TEXT("%d%% ب®·ü·خ ؤ،¸يإ¸ °ّ°ف");
- case POINT_RESIST_CRITICAL: return LC_TEXT("»َ´ëہا ؤ،¸يإ¸ ب®·ü %d%% °¨¼ز");
- case POINT_PENETRATE_PCT: return LC_TEXT("%d%% ب®·ü·خ °üإë °ّ°ف");
- case POINT_RESIST_PENETRATE: return LC_TEXT("»َ´ëہا °üإë °ّ°ف ب®·ü %d%% °¨¼ز");
- case POINT_ATTBONUS_HUMAN: return LC_TEXT("ہخ°£·ù ¸َ½؛إح إ¸°فؤ، +%d%%");
- case POINT_ATTBONUS_ANIMAL: return LC_TEXT("µ؟¹°·ù ¸َ½؛إح إ¸°فؤ، +%d%%");
- case POINT_ATTBONUS_ORC: return LC_TEXT("؟ُ±حء· إ¸°فؤ، +%d%%");
- case POINT_ATTBONUS_MILGYO: return LC_TEXT("¹ذ±³·ù إ¸°فؤ، +%d%%");
- case POINT_ATTBONUS_UNDEAD: return LC_TEXT("½أأ¼·ù إ¸°فؤ، +%d%%");
- case POINT_ATTBONUS_DEVIL: return LC_TEXT("¾ا¸¶·ù إ¸°فؤ، +%d%%");
- case POINT_STEAL_HP: return LC_TEXT("إ¸°فؤ، %d%% ¸¦ »¸ي·آہ¸·خ بي¼ِ");
- case POINT_STEAL_SP: return LC_TEXT("إ¸·آؤ، %d%% ¸¦ ء¤½إ·آہ¸·خ بي¼ِ");
- case POINT_MANA_BURN_PCT: return LC_TEXT("%d%% ب®·ü·خ إ¸°ف½أ »َ´ë ہü½إ·آ ¼ز¸ً");
- case POINT_DAMAGE_SP_RECOVER: return LC_TEXT("%d%% ب®·ü·خ اااط½أ ء¤½إ·آ ب¸؛¹");
- case POINT_BLOCK: return LC_TEXT("¹°¸®إ¸°ف½أ ؛ي·° ب®·ü %d%%");
- case POINT_DODGE: return LC_TEXT("ب° °ّ°ف ب¸اا ب®·ü %d%%");
- case POINT_RESIST_SWORD: return LC_TEXT("ار¼ص°ث ¹و¾î %d%%");
- case POINT_RESIST_TWOHAND: return LC_TEXT("¾ç¼ص°ث ¹و¾î %d%%");
- case POINT_RESIST_DAGGER: return LC_TEXT("µخ¼ص°ث ¹و¾î %d%%");
- case POINT_RESIST_BELL: return LC_TEXT("¹و؟ï ¹و¾î %d%%");
- case POINT_RESIST_FAN: return LC_TEXT("؛خأ¤ ¹و¾î %d%%");
- case POINT_RESIST_BOW: return LC_TEXT("ب°°ّ°ف ہْا× %d%%");
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case POINT_RESIST_CLAW: return LC_TEXT("µخ¼ص°ث ¹و¾î %d%%");
- #endif
- case POINT_RESIST_FIRE: return LC_TEXT("ب؟° ہْا× %d%%");
- case POINT_RESIST_ELEC: return LC_TEXT("ہü±â ہْا× %d%%");
- case POINT_RESIST_MAGIC: return LC_TEXT("¸¶¹ ہْا× %d%%");
- #ifdef ENABLE_MAGIC_REDUCTION_SYSTEM
- case POINT_RESIST_MAGIC_REDUCTION: return LC_TEXT("¸¶¹ ہْا× %d%%");
- #endif
- case POINT_RESIST_WIND: return LC_TEXT("¹ظ¶÷ ہْا× %d%%");
- case POINT_RESIST_ICE: return LC_TEXT("³أ±â ہْا× %d%%");
- case POINT_RESIST_EARTH: return LC_TEXT("´ëءِ ہْا× %d%%");
- case POINT_RESIST_DARK: return LC_TEXT("¾îµز ہْا× %d%%");
- case POINT_REFLECT_MELEE: return LC_TEXT("ء÷ء¢ إ¸°فؤ، ¹ف»ç ب®·ü : %d%%");
- case POINT_REFLECT_CURSE: return LC_TEXT("ہْءض µاµ¹¸®±â ب®·ü %d%%");
- case POINT_POISON_REDUCE: return LC_TEXT("µ¶ ہْا× %d%%");
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case POINT_BLEEDING_REDUCE: return LC_TEXT("µ¶ ہْا× %d%%");
- #endif
- case POINT_KILL_SP_RECOVER: return LC_TEXT("%d%% ب®·ü·خ ہûإًؤ،½أ ء¤½إ·آ ب¸؛¹");
- case POINT_EXP_DOUBLE_BONUS: return LC_TEXT("%d%% ب®·ü·خ ہûإًؤ،½أ °واèؤ، أك°، »َ½آ");
- case POINT_GOLD_DOUBLE_BONUS: return LC_TEXT("%d%% ب®·ü·خ ہûإًؤ،½أ µ· 2¹è µه·س");
- case POINT_ITEM_DROP_BONUS: return LC_TEXT("%d%% ب®·ü·خ ہûإًؤ،½أ ¾ئہجإغ 2¹è µه·س");
- case POINT_POTION_BONUS: return LC_TEXT("¹°¾à »ç؟ë½أ %d%% ¼؛´ة ءُ°،");
- case POINT_KILL_HP_RECOVERY: return LC_TEXT("%d%% ب®·ü·خ ہûإًؤ،½أ »¸ي·آ ب¸؛¹");
- // case POINT_IMMUNE_STUN: return LC_TEXT("±âہادءِ ¾تہ½ %d%%");
- // case POINT_IMMUNE_SLOW: return LC_TEXT("´ہ·ءءِءِ ¾تہ½ %d%%");
- // case POINT_IMMUNE_FALL: return LC_TEXT("³ر¾îءِءِ ¾تہ½ %d%%");
- // case POINT_SKILL: return LC_TEXT("");
- // case POINT_BOW_DISTANCE: return LC_TEXT("");
- case POINT_ATT_GRADE_BONUS: return LC_TEXT("°ّ°ف·آ +%d");
- case POINT_DEF_GRADE_BONUS: return LC_TEXT("¹و¾î·آ +%d");
- case POINT_MAGIC_ATT_GRADE: return LC_TEXT("¸¶¹ °ّ°ف·آ +%d");
- case POINT_MAGIC_DEF_GRADE: return LC_TEXT("¸¶¹ ¹و¾î·آ +%d");
- // case POINT_CURSE_PCT: return LC_TEXT("");
- case POINT_MAX_STAMINA: return LC_TEXT("أض´ë ءِ±¸·آ +%d");
- case POINT_ATTBONUS_WARRIOR: return LC_TEXT("¹«»ç؟،°ش °اش +%d%%");
- case POINT_ATTBONUS_ASSASSIN: return LC_TEXT("ہع°´؟،°ش °اش +%d%%");
- case POINT_ATTBONUS_SURA: return LC_TEXT("¼ِ¶َ؟،°ش °اش +%d%%");
- case POINT_ATTBONUS_SHAMAN: return LC_TEXT("¹«´ç؟،°ش °اش +%d%%");
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case POINT_ATTBONUS_WOLFMAN: return LC_TEXT("¹«´ç؟،°ش °اش +%d%%");
- #endif
- case POINT_ATTBONUS_MONSTER: return LC_TEXT("¸َ½؛إح؟،°ش °اش +%d%%");
- case POINT_MALL_ATTBONUS: return LC_TEXT("°ّ°ف·آ +%d%%");
- case POINT_MALL_DEFBONUS: return LC_TEXT("¹و¾î·آ +%d%%");
- case POINT_MALL_EXPBONUS: return LC_TEXT("°واèؤ، %d%%");
- case POINT_MALL_ITEMBONUS: return LC_TEXT("¾ئہجإغ µه·سہ² %.1f¹è");
- case POINT_MALL_GOLDBONUS: return LC_TEXT("µ· µه·سہ² %.1f¹è");
- case POINT_MAX_HP_PCT: return LC_TEXT("أض´ë »¸ي·آ +%d%%");
- case POINT_MAX_SP_PCT: return LC_TEXT("أض´ë ء¤½إ·آ +%d%%");
- case POINT_SKILL_DAMAGE_BONUS: return LC_TEXT("½؛إ³ µ¥¹جءِ %d%%");
- case POINT_NORMAL_HIT_DAMAGE_BONUS: return LC_TEXT("ئٍإ¸ µ¥¹جءِ %d%%");
- case POINT_SKILL_DEFEND_BONUS: return LC_TEXT("½؛إ³ µ¥¹جءِ ہْا× %d%%");
- case POINT_NORMAL_HIT_DEFEND_BONUS: return LC_TEXT("ئٍإ¸ µ¥¹جءِ ہْا× %d%%");
- // case POINT_PC_BANG_EXP_BONUS: return LC_TEXT("");
- // case POINT_PC_BANG_DROP_BONUS: return LC_TEXT("");
- // case POINT_EXTRACT_HP_PCT: return LC_TEXT("");
- case POINT_RESIST_WARRIOR: return LC_TEXT("¹«»ç°ّ°ف؟، %d%% ہْا×");
- case POINT_RESIST_ASSASSIN: return LC_TEXT("ہع°´°ّ°ف؟، %d%% ہْا×");
- case POINT_RESIST_SURA: return LC_TEXT("¼ِ¶َ°ّ°ف؟، %d%% ہْا×");
- case POINT_RESIST_SHAMAN: return LC_TEXT("¹«´ç°ّ°ف؟، %d%% ہْا×");
- #ifdef ENABLE_WOLFMAN_CHARACTER
- case POINT_RESIST_WOLFMAN: return LC_TEXT("¹«´ç°ّ°ف؟، %d%% ہْا×");
- #endif
- #ifdef ENABLE_PENDANT
- case POINT_ATTBONUS_SWORD: return LC_TEXT("Anti Magic1 Resistance %d%%");
- case POINT_ATTBONUS_TWOHAND: return LC_TEXT("Anti Magic2 Resistance %d%%");
- case POINT_ATTBONUS_DAGGER: return LC_TEXT("Anti Magic3 Resistance %d%%");
- case POINT_ATTBONUS_BELL: return LC_TEXT("Anti Magic4 Resistance %d%%");
- case POINT_ATTBONUS_FAN: return LC_TEXT("Anti Magic5 Resistance %d%%");
- case POINT_ATTBONUS_BOW: return LC_TEXT("Anti Magic6 Resistance %d%%");
- case POINT_ATTBONUS_CLAW: return LC_TEXT("Anti Magic7 Resistance %d%%");
- #endif
- default: return NULL;
- }
- }
- static bool FN_hair_affect_string(LPCHARACTER ch, char *buf, size_t bufsiz)
- {
- if (NULL == ch || NULL == buf)
- return false;
- CAffect* aff = NULL;
- time_t expire = 0;
- struct tm ltm;
- int year, mon, day;
- int offset = 0;
- aff = ch->FindAffect(AFFECT_HAIR);
- if (NULL == aff)
- return false;
- expire = ch->GetQuestFlag("hair.limit_time");
- if (expire < get_global_time())
- return false;
- // set apply string
- offset = snprintf(buf, bufsiz, FN_point_string(aff->bApplyOn), aff->lApplyValue);
- if (offset < 0 || offset >= (int) bufsiz)
- offset = bufsiz - 1;
- localtime_r(&expire, <m);
- year = ltm.tm_year + 1900;
- mon = ltm.tm_mon + 1;
- day = ltm.tm_mday;
- snprintf(buf + offset, bufsiz - offset, LC_TEXT(" (¸¸·لہد : %d³â %d؟ù %dہد)"), year, mon, day);
- return true;
- }
- ACMD(do_costume)
- {
- char buf[512];
- const size_t bufferSize = sizeof(buf);
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- CItem* pBody = ch->GetWear(WEAR_COSTUME_BODY);
- CItem* pHair = ch->GetWear(WEAR_COSTUME_HAIR);
- #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
- CItem* pMount = ch->GetWear(WEAR_COSTUME_MOUNT);
- #endif
- #ifdef ENABLE_ACCE_COSTUME_SYSTEM
- CItem* pAcce = ch->GetWear(WEAR_COSTUME_ACCE);
- #endif
- #ifdef ENABLE_WEAPON_COSTUME_SYSTEM
- CItem* pWeapon = ch->GetWear(WEAR_COSTUME_WEAPON);
- #endif
- ch->ChatPacket(CHAT_TYPE_INFO, "COSTUME status:");
- if (pHair)
- {
- const char* itemName = pHair->GetName();
- ch->ChatPacket(CHAT_TYPE_INFO, " HAIR : %s", itemName);
- for (int i = 0; i < pHair->GetAttributeCount(); ++i)
- {
- const TPlayerItemAttribute& attr = pHair->GetAttribute(i);
- if (0 < attr.bType)
- {
- snprintf(buf, bufferSize, FN_point_string(attr.bType), attr.sValue);
- ch->ChatPacket(CHAT_TYPE_INFO, " %s", buf);
- }
- }
- if (pHair->IsEquipped() && arg1[0] == 'h')
- ch->UnequipItem(pHair);
- }
- if (pBody)
- {
- const char* itemName = pBody->GetName();
- ch->ChatPacket(CHAT_TYPE_INFO, " BODY : %s", itemName);
- if (pBody->IsEquipped() && arg1[0] == 'b')
- ch->UnequipItem(pBody);
- }
- #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
- if (pMount)
- {
- const char* itemName = pMount->GetName();
- ch->ChatPacket(CHAT_TYPE_INFO, " MOUNT : %s", itemName);
- if (pMount->IsEquipped() && arg1[0] == 'm')
- ch->UnequipItem(pMount);
- }
- #endif
- #ifdef ENABLE_ACCE_COSTUME_SYSTEM
- if (pAcce)
- {
- const char * itemName = pAcce->GetName();
- ch->ChatPacket(CHAT_TYPE_INFO, " ACCE: %s", itemName);
- for (int i = 0; i < pAcce->GetAttributeCount(); ++i)
- {
- const TPlayerItemAttribute& attr = pAcce->GetAttribute(i);
- if (attr.bType > 0)
- {
- const char * pAttrName = FN_point_string(attr.bType);
- if (pAttrName == NULL)
- continue;
- snprintf(buf, sizeof(buf), FN_point_string(attr.bType), attr.sValue);
- ch->ChatPacket(CHAT_TYPE_INFO, " %s", buf);
- }
- }
- if (pAcce->IsEquipped() && arg1[0] == 's')
- ch->UnequipItem(pAcce);
- }
- #endif
- #ifdef ENABLE_WEAPON_COSTUME_SYSTEM
- if (pWeapon)
- {
- const char* itemName = pWeapon->GetName();
- ch->ChatPacket(CHAT_TYPE_INFO, " WEAPON : %s", itemName);
- if (pWeapon->IsEquipped() && arg1[0] == 'w')
- ch->UnequipItem(pWeapon);
- }
- #endif
- }
- ACMD(do_hair)
- {
- char buf[256];
- if (false == FN_hair_affect_string(ch, buf, sizeof(buf)))
- return;
- ch->ChatPacket(CHAT_TYPE_INFO, buf);
- }
- ACMD(do_inventory)
- {
- int index = 0;
- int count = 1;
- char arg1[256];
- char arg2[256];
- LPITEM item;
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Usage: inventory <start_index> <count>");
- return;
- }
- if (!*arg2)
- {
- index = 0;
- str_to_number(count, arg1);
- }
- else
- {
- str_to_number(index, arg1); index = MIN(index, INVENTORY_MAX_NUM);
- str_to_number(count, arg2); count = MIN(count, INVENTORY_MAX_NUM);
- }
- for (int i = 0; i < count; ++i)
- {
- if (index >= INVENTORY_MAX_NUM)
- break;
- item = ch->GetInventoryItem(index);
- ch->ChatPacket(CHAT_TYPE_INFO, "inventory [%d] = %s",
- index, item ? item->GetName() : "<NONE>");
- ++index;
- }
- }
- #ifdef ENABLE_ATTR_TRANSFER_SYSTEM
- ACMD(do_attr_transfer)
- {
- if (!ch->CanDoAttrTransfer())
- return;
- sys_log(1, "%s has used an Attr Transfer command: %s.", ch->GetName(), argument);
- int w_index = 0, i_index = 0;
- const char *line;
- char arg1[256], arg2[256], arg3[256];
- line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- one_argument(line, arg3, sizeof(arg3));
- if (0 == arg1[0])
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Usage:");
- ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer open");
- ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer close");
- ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer add <attr_transfer_slot> <inventory_slot>");
- ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer delete <attr_transfer_slot>");
- return;
- }
- const std::string& strArg1 = std::string(arg1);
- if (strArg1 == "open")
- {
- AttrTransfer_open(ch);
- return;
- }
- else if (strArg1 == "close")
- {
- AttrTransfer_close(ch);
- return;
- }
- else if (strArg1 == "make")
- {
- AttrTransfer_make(ch);
- return;
- }
- else if (strArg1 == "add")
- {
- if (0 == arg2[0] || !isdigit(*arg2) || 0 == arg3[0] || !isdigit(*arg3))
- return;
- str_to_number(w_index, arg2);
- str_to_number(i_index, arg3);
- AttrTransfer_add_item(ch, w_index, i_index);
- return;
- }
- else if (strArg1 == "delete")
- {
- if (0 == arg2[0] || !isdigit(*arg2))
- return;
- str_to_number(w_index, arg2);
- AttrTransfer_delete_item(ch, w_index);
- return;
- }
- switch (LOWER(arg1[0]))
- {
- case 'o':
- AttrTransfer_open(ch);
- break;
- case 'c':
- AttrTransfer_close(ch);
- break;
- case 'm':
- AttrTransfer_make(ch);
- break;
- case 'a':
- {
- if (0 == arg2[0] || !isdigit(*arg2) || 0 == arg3[0] || !isdigit(*arg3))
- return;
- str_to_number(w_index, arg2);
- str_to_number(i_index, arg3);
- AttrTransfer_add_item(ch, w_index, i_index);
- }
- break;
- case 'd':
- {
- if (0 == arg2[0] || !isdigit(*arg2))
- return;
- str_to_number(w_index, arg2);
- AttrTransfer_delete_item(ch, w_index);
- }
- break;
- default:
- return;
- }
- }
- #endif
- //gift notify quest command
- ACMD(do_gift)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "gift");
- }
- #ifdef ENABLE_NEWPET_SYSTEM
- ACMD(do_CubePetAdd)
- {
- int pos = 0;
- int invpos = 0;
- const char *line;
- char arg1[256], arg2[256], arg3[256];
- line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- one_argument(line, arg3, sizeof(arg3));
- if (0 == arg1[0])
- return;
- const std::string& strArg1 = std::string(arg1);
- (void)strArg1;
- switch (LOWER(arg1[0]))
- {
- case 'a': // add cue_index inven_index
- {
- if (0 == arg2[0] || !isdigit(*arg2) ||
- 0 == arg3[0] || !isdigit(*arg3))
- return;
- str_to_number(pos, arg2);
- str_to_number(invpos, arg3);
- }
- break;
- default:
- return;
- }
- if (ch->GetNewPetSystem()->IsActivePet())
- ch->GetNewPetSystem()->SetItemCube(pos, invpos);
- else
- return;
- }
- ACMD(do_PetSkill)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD skillslot = 0;
- str_to_number(skillslot, arg1);
- if (skillslot > 2 || skillslot < 0)
- return;
- if (ch->GetNewPetSystem()->IsActivePet())
- ch->GetNewPetSystem()->DoPetSkill(skillslot);
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You must have summoned the pet to proceed."));
- }
- ACMD(do_FeedCubePet)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- DWORD feedtype = 0;
- str_to_number(feedtype, arg1);
- if (ch->GetNewPetSystem()->IsActivePet())
- ch->GetNewPetSystem()->ItemCubeFeed(feedtype);
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You don't have a called attendant."));
- }
- ACMD(do_PetEvo)
- {
- if (ch->GetExchange() || ch->GetMyShop() || ch->GetShopOwner() || ch->IsOpenSafebox() || ch->IsCubeOpen())
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[PetEvolution] You cannot evolve your pet now!"));
- return;
- }
- if (ch->GetNewPetSystem()->IsActivePet())
- {
- int it[3][7] =
- {
- { 55003, 30058, 30073, 30041, 30017, 30074, 30088 }, //Here Modify Items to request for 1 evo
- { 55004, 27994, 30035, 30089, 30031, 30011, 30080 }, //Here Modify Items to request for 2 evo
- { 55005, 30083, 27992, 27993, 30086, 30077, 30550 } //Here Modify Items to request for 3 evo
- };
- int ic[3][7] =
- {
- { 10, 10, 10, 10, 10, 5, 5 },
- { 10, 2, 10, 10, 10, 10, 5 },
- { 10, 10, 2, 2, 10, 10, 5 }
- };
- int tmpevo = ch->GetNewPetSystem()->GetEvolution();
- if (tmpevo == 2 && ch->GetNewPetSystem()->GetLevel() == 81 && ch->GetNewPetSystem()->GetYas() < 30)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Your pet's age must be at least 30 days!");
- return;
- }
- if (ch->GetNewPetSystem()->GetLevel() == 40 && tmpevo == 0 ||
- ch->GetNewPetSystem()->GetLevel() >= 81 && tmpevo == 1 ||
- ch->GetNewPetSystem()->GetLevel() >= 81 && tmpevo == 2)
- {
- for (int b = 0; b < 7; b++)
- {
- if (ch->CountSpecifyItem(it[tmpevo][b]) < ic[tmpevo][b])
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[PetEvolution] Items Required:"));
- for (int c = 0; c < 7; c++)
- {
- DWORD vnum = it[tmpevo][c];
- //ch->ChatPacket(CHAT_TYPE_INFO, "%s x%d , %s x%d , %s x%d , %s x%d , %s x%d , %s x%d , %s x%d", ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c] , ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c]);
- ch->ChatPacket(CHAT_TYPE_INFO, "%s x%d", ITEM_MANAGER::instance().GetTable(vnum)->szLocaleName , ic[tmpevo][c]);
- }
- return;
- }
- }
- for (int c = 0; c < 7; c++)
- {
- ch->RemoveSpecifyItem(it[tmpevo][c], ic[tmpevo][c]);
- }
- ch->GetNewPetSystem()->IncreasePetEvolution();
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't evolve your pet!"));
- return;
- }
- }
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your pet should be summoned!"));
- }
- ACMD(do_PetChangeName)
- {
- char arg1[256], arg2[256];
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1 || !*arg2)
- return;
- int bCell = 0;
- str_to_number(bCell, arg1);
- LPITEM item = ch->GetInventoryItem(bCell);
- if (!item)
- return;
- if (ch->CountSpecifyItem(55008) < 1)
- return;
- if (ch->GetGold() < 100000)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°³·®ہ» اد±â ہ§ار µ·ہج ؛خء·اص´د´ظ."));
- return;
- }
- if (ch->GetNewPetSystem()->IsActivePet())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("The activated pet cannot be selected."));
- return;
- }
- DBManager::instance().DirectQuery("UPDATE new_petsystem SET name = '%s' WHERE id = '%d'", arg2, item->GetID());
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Success."));
- ch->RemoveSpecifyItem(55008, 1);
- ch->PointChange(POINT_GOLD, -100000);
- }
- #endif
- #ifdef ENABLE_AUTO_HUNT_SYSTEM
- ACMD(do_autohunt_activate)
- {
- if (ch->GetAutoHuntStatus() == false)
- ch->SetAutoHuntStatus(true);
- else
- ch->SetAutoHuntStatus(false);
- }
- #endif
- #ifdef ENABLE_GEM_SYSTEM
- ACMD(do_gaya_system)
- {
- char arg1[255];
- char arg2[255];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (0 == arg1[0])
- return;
- const std::string& strArg1 = std::string(arg1);
- if (strArg1 == "craft"){
- if (0 == arg2[0])
- return;
- int slot = atoi(arg2);
- ch->CraftGayaItems(slot);
- }
- else if(strArg1 == "market"){
- if (0 == arg2[0])
- return;
- int slot = atoi(arg2);
- ch->MarketGayaItems(slot);
- }
- else if(strArg1 == "refresh")
- {
- ch->RefreshGayaItems();
- }
- }
- #endif
- #ifdef ENABLE_12ZI
- ACMD(do_open_cz)
- {
- int iPulse = thecore_pulse();
- if (iPulse - ch->GetLastZodiacCzLastTime() < passes_per_sec * 1)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You have to wait a bit.");
- return;
- }
- ch->SetLastZodiacCzLastTime(iPulse);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenUI12zi %d %d %d %d %d", ch->GetYellowmark(), ch->GetGreenmark(), ch->GetYellowreward(), ch->GetGreenreward(), ch->GetGoldreward());
- }
- ACMD(do_cz_reward)
- {
- int iPulse = thecore_pulse();
- if (iPulse - ch->GetLastZodiacCzLastTime() < passes_per_sec * 1)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You have to wait a bit.");
- return;
- }
- ch->SetLastZodiacCzLastTime(iPulse);
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "Missing action applied!");
- return;
- }
- BYTE type = 0;
- str_to_number(type, arg1);
- if (type == 1)
- {
- if (ch->GetYellowmark() == 1073741823)
- {
- ch->AutoGiveItem(33026, 1);
- ch->SetYellowreward(1);
- ch->ClearYellowMark();
- }
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough coffins!");
- return;
- }
- }
- else if (type == 2)
- {
- if (ch->GetGreenmark() == 1073741823)
- {
- ch->AutoGiveItem(33027, 1);
- ch->SetGreenreward(1);
- ch->ClearGreenMark();
- }
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough Green Box points!");
- return;
- }
- }
- else if (type == 3)
- {
- int sari = ch->GetYellowreward();
- int yesil = ch->GetGreenreward();
- int altin = ch->GetGoldreward();
- if ((sari-altin) == 0 || (yesil-altin) == 0)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You do not have enough Yildiz coffins!");
- return;
- }
- ch->AutoGiveItem(33028, 1);
- ch->SetGoldreward(1);
- }
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenUI12zi %d %d %d %d %d", ch->GetYellowmark(), ch->GetGreenmark(), ch->GetYellowreward(), ch->GetGreenreward(), ch->GetGoldreward());
- }
- ACMD(do_cz_check_box)
- {
- if (!ch)
- return;
- int iPulse = thecore_pulse();
- if (iPulse - ch->GetLastZodiacCzLastTime() < passes_per_sec / 2)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You have to wait a bit.");
- return;
- }
- ch->SetLastZodiacCzLastTime(iPulse);
- char arg1[256];
- char arg2[256];
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (!*arg1 || !*arg2)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "Missing action applied!");
- return;
- }
- BYTE type = 0, value = 0, zero = 0;
- str_to_number(type, arg1);
- str_to_number(value, arg2);
- DWORD column_item_list_yellow[] = { 33001, 33003, 33005, 33007, 33009, 33011 };
- DWORD column_item_list_green[] = { 33002, 33004, 33006, 33008, 33010, 33012 };
- DWORD row_item_list_yellow[] = { 33013, 33015, 33017, 33019, 33021 };
- DWORD row_item_list_green[] = { 33014, 33016, 33018, 33020, 33022 };
- {
- if (type == 0)
- {
- if (value == 0 || value == 6 || value == 12 || value == 18 || value == 24)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[0]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[0], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 1 || value == 7 || value == 13 || value == 19 || value == 25)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[1]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[1], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 2 || value == 8 || value == 14 || value == 20 || value == 26)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[2]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[2], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 3 || value == 9 || value == 15 || value == 21 || value == 27)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[3]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[3], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 4 || value == 10 || value == 16 || value == 22 || value == 28)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[4]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[4], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 5 || value == 11 || value == 17 || value == 23 || value == 29)
- {
- if (ch->CountSpecifyItem(column_item_list_yellow[5]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_yellow[5], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- if (value >= zero && value <= 5)
- {
- if (ch->CountSpecifyItem(row_item_list_yellow[0]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_yellow[0], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 6 && value <= 11)
- {
- if (ch->CountSpecifyItem(row_item_list_yellow[1]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_yellow[1], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 12 && value <= 17)
- {
- if (ch->CountSpecifyItem(row_item_list_yellow[2]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_yellow[2], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 18 && value <= 23)
- {
- if (ch->CountSpecifyItem(row_item_list_yellow[3]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_yellow[3], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 24 && value <= 29)
- {
- if (ch->CountSpecifyItem(row_item_list_yellow[4]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_yellow[4], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- }
- else
- {
- if (value == 0 || value == 6 || value == 12 || value == 18 || value == 24)
- {
- if (ch->CountSpecifyItem(column_item_list_green[0]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[0], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 1 || value == 7 || value == 13 || value == 19 || value == 25)
- {
- if (ch->CountSpecifyItem(column_item_list_green[1]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[1], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 2 || value == 8 || value == 14 || value == 20 || value == 26)
- {
- if (ch->CountSpecifyItem(column_item_list_green[2]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[2], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 3 || value == 9 || value == 15 || value == 21 || value == 27)
- {
- if (ch->CountSpecifyItem(column_item_list_green[3]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[3], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 4 || value == 10 || value == 16 || value == 22 || value == 28)
- {
- if (ch->CountSpecifyItem(column_item_list_green[4]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[4], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value == 5 || value == 11 || value == 17 || value == 23 || value == 29)
- {
- if (ch->CountSpecifyItem(column_item_list_green[5]) >= 50)
- ch->RemoveSpecifyItem(column_item_list_green[5], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- if (value >= zero && value <= 5)
- {
- if (ch->CountSpecifyItem(row_item_list_green[0]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_green[0], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 6 && value <= 11)
- {
- if (ch->CountSpecifyItem(row_item_list_green[1]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_green[1], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 12 && value <= 17)
- {
- if (ch->CountSpecifyItem(row_item_list_green[2]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_green[2], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 18 && value <= 23)
- {
- if (ch->CountSpecifyItem(row_item_list_green[3]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_green[3], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- else if (value >= 24 && value <= 29)
- {
- if (ch->CountSpecifyItem(row_item_list_green[4]) >= 50)
- ch->RemoveSpecifyItem(row_item_list_green[4], 50);
- else
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, "You don't have enough zodiac charm!");
- return;
- }
- }
- }
- }
- int size = 1;
- for (BYTE b = 0; b < value; ++b)
- size *= 2;
- if (type == 0)
- ch->SetYellowmark(size);
- else
- ch->SetGreenmark(size);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenUI12zi %d %d %d %d %d", ch->GetYellowmark(), ch->GetGreenmark(), ch->GetYellowreward(), ch->GetGreenreward(), ch->GetGoldreward());
- }
- ACMD(do_revivedialog)
- {
- if (!ch)
- return;
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Veri eksik!");
- return;
- }
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (!tch)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltecek kisi yok!");
- return;
- }
- if (!tch->IsPC())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltmeye calistiginiz kisi insan degil!");
- return;
- }
- if (!tch->IsDead())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltmeye calistiginiz kisi olu degil!");
- return;
- }
- BYTE Adet = tch->GetDeadCount() >= 1 ? tch->GetDeadCount()*2 : 1;
- ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenReviveDialog %u %u", (DWORD)tch->GetVID(), Adet);
- }
- ACMD(do_revive)
- {
- if (!ch)
- return;
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Veri eksik!");
- return;
- }
- DWORD vid = 0;
- str_to_number(vid, arg1);
- LPCHARACTER tch = CHARACTER_MANAGER::instance().Find(vid);
- if (!tch)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltecek kisi yok!");
- return;
- }
- if (!tch->IsPC())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltmeye calistiginiz kisi insan degil!");
- return;
- }
- if (!tch->IsDead())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Diriltmeye calistiginiz kisi olu degil!");
- return;
- }
- if (!(ch->GetMapIndex() >= 3580000 && ch->GetMapIndex() < 3590000) || !(tch->GetMapIndex() >= 3580000 && tch->GetMapIndex() < 3590000))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Zodyak tapinaginda degilsiniz!");
- return;
- }
- BYTE Adet = tch->GetDeadCount() >= 1 ? tch->GetDeadCount()*2 : 1;
- if (ch->CountSpecifyItem(33025) < (int)Adet)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "NotEnoughPrism %u", Adet);
- return;
- }
- ch->RemoveSpecifyItem(33025, Adet);
- tch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow");
- tch->GetDesc()->SetPhase(PHASE_GAME);
- tch->SetPosition(POS_STANDING);
- tch->StartRecoveryEvent();
- tch->RestartAtSamePos();
- tch->PointChange(POINT_HP, tch->GetMaxHP() - tch->GetHP());
- tch->PointChange(POINT_SP, tch->GetMaxSP() - tch->GetSP());
- tch->ReviveInvisible(5);
- sys_log(0, "do_restart: restart here zodiac");
- }
- ACMD(do_jump_floor)
- {
- if (ch)
- {
- if ((ch->GetParty() && ch->GetParty()->GetLeaderPID() == ch->GetPlayerID()) || !ch->GetParty())
- {
- LPZODIAC pkZodiac = CZodiacManager::instance().FindByMapIndex(ch->GetMapIndex());
- if (pkZodiac && pkZodiac->IsNextFloor() == true)
- {
- pkZodiac->NewFloor(pkZodiac->GetNextFloor());
- }
- }
- }
- }
- ACMD(do_next_floor)
- {
- if (ch)
- {
- if ((ch->GetParty() && ch->GetParty()->GetLeaderPID() == ch->GetPlayerID()) || !ch->GetParty())
- {
- LPZODIAC pkZodiac = CZodiacManager::instance().FindByMapIndex(ch->GetMapIndex());
- if (pkZodiac && pkZodiac->IsNextFloor() == true)
- {
- pkZodiac->NewFloor(pkZodiac->GetFloor()+1);
- }
- }
- }
- }
- #endif
- ACMD(do_cube)
- {
- if (!ch->CanDoCube())
- return;
- dev_log(LOG_DEB0, "CUBE COMMAND <%s>: %s", ch->GetName(), argument);
- int cube_index = 0, inven_index = 0;
- const char *line;
- char arg1[256], arg2[256], arg3[256];
- line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- one_argument(line, arg3, sizeof(arg3));
- if (0 == arg1[0])
- {
- // print usage
- ch->ChatPacket(CHAT_TYPE_INFO, "Usage: cube open");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube close");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube add <inveltory_index>");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube delete <cube_index>");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube list");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube cancel");
- ch->ChatPacket(CHAT_TYPE_INFO, " cube make [all]");
- return;
- }
- const std::string& strArg1 = std::string(arg1);
- // r_info (request information)
- // /cube r_info ==> (Client -> Server) اِہç NPC°، ¸¸µé ¼ِ ہض´آ ·¹½أاا ؟نأ»
- // (Server -> Client) /cube r_list npcVNUM resultCOUNT 123,1/125,1/128,1/130,5
- //
- // /cube r_info 3 ==> (Client -> Server) اِہç NPC°، ¸¸µé¼ِ ہض´آ ·¹½أاا ءك 3¹ّآ° ¾ئہجإغہ» ¸¸µه´آ µ¥ ات؟نار ء¤؛¸¸¦ ؟نأ»
- // /cube r_info 3 5 ==> (Client -> Server) اِہç NPC°، ¸¸µé¼ِ ہض´آ ·¹½أاا ءك 3¹ّآ° ¾ئہجإغ؛خإح ہجبؤ 5°³ہا ¾ئہجإغہ» ¸¸µه´آ µ¥ ات؟نار ہç·ل ء¤؛¸¸¦ ؟نأ»
- // (Server -> Client) /cube m_info startIndex count 125,1|126,2|127,2|123,5&555,5&555,4/120000@125,1|126,2|127,2|123,5&555,5&555,4/120000
- //
- if (strArg1 == "r_info")
- {
- if (0 == arg2[0])
- Cube_request_result_list(ch);
- else
- {
- if (isdigit(*arg2))
- {
- int listIndex = 0, requestCount = 1;
- str_to_number(listIndex, arg2);
- if (0 != arg3[0] && isdigit(*arg3))
- str_to_number(requestCount, arg3);
- Cube_request_material_info(ch, listIndex, requestCount);
- }
- }
- return;
- }
- switch (LOWER(arg1[0]))
- {
- case 'o': // open
- Cube_open(ch);
- break;
- case 'c': // close
- Cube_close(ch);
- break;
- case 'l': // list
- Cube_show_list(ch);
- break;
- case 'a': // add cue_index inven_index
- {
- if (0 == arg2[0] || !isdigit(*arg2) ||
- 0 == arg3[0] || !isdigit(*arg3))
- return;
- str_to_number(cube_index, arg2);
- str_to_number(inven_index, arg3);
- Cube_add_item (ch, cube_index, inven_index);
- }
- break;
- case 'd': // delete
- {
- if (0 == arg2[0] || !isdigit(*arg2))
- return;
- str_to_number(cube_index, arg2);
- Cube_delete_item (ch, cube_index);
- }
- break;
- case 'm': // make
- if (0 != arg2[0])
- {
- while (true == Cube_make(ch))
- dev_log (LOG_DEB0, "cube make success");
- }
- else
- Cube_make(ch);
- break;
- default:
- return;
- }
- }
- ACMD(do_in_game_mall)
- {
- if (LC_IsEurope() == true)
- {
- char country_code[3];
- switch (LC_GetLocalType())
- {
- case LC_GERMANY: country_code[0] = 'd'; country_code[1] = 'e'; country_code[2] = '\0'; break;
- case LC_FRANCE: country_code[0] = 'f'; country_code[1] = 'r'; country_code[2] = '\0'; break;
- case LC_ITALY: country_code[0] = 'i'; country_code[1] = 't'; country_code[2] = '\0'; break;
- case LC_SPAIN: country_code[0] = 'e'; country_code[1] = 's'; country_code[2] = '\0'; break;
- case LC_UK: country_code[0] = 'e'; country_code[1] = 'n'; country_code[2] = '\0'; break;
- case LC_TURKEY: country_code[0] = 't'; country_code[1] = 'r'; country_code[2] = '\0'; break;
- case LC_POLAND: country_code[0] = 'p'; country_code[1] = 'l'; country_code[2] = '\0'; break;
- case LC_PORTUGAL: country_code[0] = 'p'; country_code[1] = 't'; country_code[2] = '\0'; break;
- case LC_GREEK: country_code[0] = 'g'; country_code[1] = 'r'; country_code[2] = '\0'; break;
- case LC_RUSSIA: country_code[0] = 'r'; country_code[1] = 'u'; country_code[2] = '\0'; break;
- case LC_DENMARK: country_code[0] = 'd'; country_code[1] = 'k'; country_code[2] = '\0'; break;
- case LC_BULGARIA: country_code[0] = 'b'; country_code[1] = 'g'; country_code[2] = '\0'; break;
- case LC_CROATIA: country_code[0] = 'h'; country_code[1] = 'r'; country_code[2] = '\0'; break;
- case LC_MEXICO: country_code[0] = 'm'; country_code[1] = 'x'; country_code[2] = '\0'; break;
- case LC_ARABIA: country_code[0] = 'a'; country_code[1] = 'e'; country_code[2] = '\0'; break;
- case LC_CZECH: country_code[0] = 'c'; country_code[1] = 'z'; country_code[2] = '\0'; break;
- case LC_ROMANIA: country_code[0] = 'r'; country_code[1] = 'o'; country_code[2] = '\0'; break;
- case LC_HUNGARY: country_code[0] = 'h'; country_code[1] = 'u'; country_code[2] = '\0'; break;
- case LC_NETHERLANDS: country_code[0] = 'n'; country_code[1] = 'l'; country_code[2] = '\0'; break;
- case LC_USA: country_code[0] = 'u'; country_code[1] = 's'; country_code[2] = '\0'; break;
- case LC_CANADA: country_code[0] = 'c'; country_code[1] = 'a'; country_code[2] = '\0'; break;
- default:
- if (test_server == true)
- {
- country_code[0] = 'd'; country_code[1] = 'e'; country_code[2] = '\0';
- }
- break;
- }
- char buf[512+1];
- char sas[33];
- MD5_CTX ctx;
- const char sas_key[] = "GF9001";
- snprintf(buf, sizeof(buf), "%u%u%s", ch->GetPlayerID(), ch->GetAID(), sas_key);
- MD5Init(&ctx);
- MD5Update(&ctx, (const unsigned char *) buf, strlen(buf));
- #ifdef __FreeBSD__
- MD5End(&ctx, sas);
- #else
- static const char hex[] = "0123456789abcdef";
- unsigned char digest[16];
- MD5Final(digest, &ctx);
- int i;
- for (i = 0; i < 16; ++i) {
- sas[i+i] = hex[digest[i] >> 4];
- sas[i+i+1] = hex[digest[i] & 0x0f];
- }
- sas[i+i] = '\0';
- #endif
- snprintf(buf, sizeof(buf), "mall http://%s/ishop?pid=%u&c=%s&sid=%d&sas=%s",
- g_strWebMallURL.c_str(), ch->GetPlayerID(), country_code, g_server_id, sas);
- ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
- }
- }
- // ءض»çہ§
- ACMD(do_dice)
- {
- char arg1[256], arg2[256];
- int start = 1, end = 100;
- two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- if (*arg1 && *arg2)
- {
- start = atoi(arg1);
- end = atoi(arg2);
- }
- else if (*arg1 && !*arg2)
- {
- start = 1;
- end = atoi(arg1);
- }
- end = MAX(start, end);
- start = MIN(start, end);
- int n = number(start, end);
- #ifdef ENABLE_DICE_SYSTEM
- if (ch->GetParty())
- ch->GetParty()->ChatPacketToAllMember(CHAT_TYPE_DICE_INFO, LC_TEXT("%s´شہج ءض»çہ§¸¦ ±¼·ء %d°، ³ھ؟ش½ہ´د´ظ. (%d-%d)"), ch->GetName(), n, start, end);
- else
- ch->ChatPacket(CHAT_TYPE_DICE_INFO, LC_TEXT("´ç½إہج ءض»çہ§¸¦ ±¼·ء %d°، ³ھ؟ش½ہ´د´ظ. (%d-%d)"), n, start, end);
- #else
- if (ch->GetParty())
- ch->GetParty()->ChatPacketToAllMember(CHAT_TYPE_INFO, LC_TEXT("%s´شہج ءض»çہ§¸¦ ±¼·ء %d°، ³ھ؟ش½ہ´د´ظ. (%d-%d)"), ch->GetName(), n, start, end);
- else
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ç½إہج ءض»çہ§¸¦ ±¼·ء %d°، ³ھ؟ش½ہ´د´ظ. (%d-%d)"), n, start, end);
- #endif
- }
- #ifdef ENABLE_NEWSTUFF
- ACMD(do_click_safebox)
- {
- if ((ch->GetGMLevel() <= GM_PLAYER) && (ch->GetDungeon() || ch->GetWarMap()))
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot open the safebox in dungeon or at war."));
- return;
- }
- ch->SetSafeboxOpenPosition();
- ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeSafeboxPassword");
- }
- ACMD(do_force_logout)
- {
- LPDESC pDesc=DESC_MANAGER::instance().FindByCharacterName(ch->GetName());
- if (!pDesc)
- return;
- pDesc->DelayedDisconnect(0);
- }
- #endif
- ACMD(do_click_mall)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeMallPassword");
- }
- ACMD(do_ride)
- {
- dev_log(LOG_DEB0, "[DO_RIDE] start");
- if (ch->IsDead() || ch->IsStun())
- return;
- // ³»¸®±â
- {
- if (ch->IsHorseRiding())
- {
- dev_log(LOG_DEB0, "[DO_RIDE] stop riding");
- ch->StopRiding();
- return;
- }
- if (ch->GetMountVnum())
- {
- dev_log(LOG_DEB0, "[DO_RIDE] unmount");
- do_unmount(ch, NULL, 0, 0);
- return;
- }
- }
- // إ¸±â
- {
- if (ch->GetHorse() != NULL)
- {
- dev_log(LOG_DEB0, "[DO_RIDE] start riding");
- ch->StartRiding();
- return;
- }
- for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i)
- {
- LPITEM item = ch->GetInventoryItem(i);
- if (NULL == item)
- continue;
- // ہ¯´دإ© إ»°ح ¾ئہجإغ
- if (item->IsRideItem())
- {
- if (
- NULL==ch->GetWear(WEAR_UNIQUE1)
- || NULL==ch->GetWear(WEAR_UNIQUE2)
- #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
- || NULL==ch->GetWear(WEAR_COSTUME_MOUNT)
- #endif
- )
- {
- dev_log(LOG_DEB0, "[DO_RIDE] USE UNIQUE ITEM");
- //ch->EquipItem(item);
- ch->UseItem(TItemPos (INVENTORY, i));
- return;
- }
- }
- // ہد¹ف إ»°ح ¾ئہجإغ
- // TODO : إ»°ح؟ë SubType أك°،
- switch (item->GetVnum())
- {
- case 71114: // ہْ½إہج؟ë±ا
- case 71116: // »ê°ك½إہج؟ë±ا
- case 71118: // إُءِ¹üہج؟ë±ا
- case 71120: // »çہع؟صہج؟ë±ا
- dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM");
- ch->UseItem(TItemPos (INVENTORY, i));
- return;
- }
- // GF mantis #113524, 52001~52090 ¹ّ إ»°ح
- if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) ) {
- dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM");
- ch->UseItem(TItemPos (INVENTORY, i));
- return;
- }
- }
- }
- // إ¸°إ³ھ ³»¸± ¼ِ ¾ّہ»¶§
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»ہ» ¸صہْ ¼زب¯اطءض¼¼؟ن."));
- }
- #ifdef ENABLE_MINIGAME_RUMI_EVENT
- ACMD(do_cards)
- {
- const char *line;
- char arg1[256], arg2[256];
- line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- switch (LOWER(arg1[0]))
- {
- case 'o': // open
- if (isdigit(*arg2))
- {
- DWORD safemode;
- str_to_number(safemode, arg2);
- ch->Cards_open(safemode);
- }
- break;
- case 'p': // open
- ch->Cards_pullout();
- break;
- case 'e': // open
- ch->CardsEnd();
- break;
- case 'd': // open
- if (isdigit(*arg2))
- {
- DWORD destroy_index;
- str_to_number(destroy_index, arg2);
- ch->CardsDestroy(destroy_index);
- }
- break;
- case 'a': // open
- if (isdigit(*arg2))
- {
- DWORD accpet_index;
- str_to_number(accpet_index, arg2);
- ch->CardsAccept(accpet_index);
- }
- break;
- case 'r': // open
- if (isdigit(*arg2))
- {
- DWORD restore_index;
- str_to_number(restore_index, arg2);
- ch->CardsRestore(restore_index);
- }
- break;
- default:
- return;
- }
- }
- #endif
- #ifdef ENABLE_MOVE_CHANNEL
- ACMD(do_change_channel)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- DWORD channel_number = 0;
- str_to_number(channel_number, arg1);
- //if (ch->m_pkChangeChannelEvent)
- //{
- // ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Change channel canceled."));
- // event_cancel(&ch->m_pkChangeChannelEvent);
- // return;
- //}
- if(!ch)
- {
- return;
- }
- if(channel_number == 99 || g_bChannel == 99){
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot change channel."));
- return;
- }
- if (ch->GetMapIndex() == 64 || ch->GetMapIndex() == 210)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot change channel."));
- return;
- }
- if(channel_number == g_bChannel)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You are already on this channel."));
- return;
- }
- if (ch->IsDead() || ch->GetExchange())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot change channel."));
- return;
- }
- if(channel_number <= 0 || channel_number > 6)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Cannot connect to the channel at this time. Please try again later."));
- return;
- }
- if (channel_number != 0)
- {
- if (ch->m_pkChangeChannelEvent)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CH_CANCELED"));
- event_cancel(&ch->m_pkChangeChannelEvent);
- return;
- }
- ChangeChannelEventInfo* info = AllocEventInfo<ChangeChannelEventInfo>();
- {
- if (ch->IsPosition(POS_FIGHTING))
- info->left_second = 10;
- else
- info->left_second = 3;
- }
- info->ch = ch;
- info->channel_number = channel_number;
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait a moment. Changing channel..."));
- ch->m_pkChangeChannelEvent = event_create(change_channel_event, info, 1);
- }
- }
- #endif
- #ifdef __AUCTION__
- // temp_auction
- ACMD(do_get_item_id_list)
- {
- for (int i = 0; i < INVENTORY_MAX_NUM; i++)
- {
- LPITEM item = ch->GetInventoryItem(i);
- if (item != NULL)
- ch->ChatPacket(CHAT_TYPE_INFO, "name : %s id : %d", item->GetProto()->szName, item->GetID());
- }
- }
- // temp_auction
- ACMD(do_enroll_auction)
- {
- char arg1[256];
- char arg2[256];
- char arg3[256];
- char arg4[256];
- two_arguments (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3), arg4, sizeof(arg4));
- DWORD item_id = strtoul(arg1, NULL, 10);
- BYTE empire = strtoul(arg2, NULL, 10);
- int bidPrice = strtol(arg3, NULL, 10);
- int immidiatePurchasePrice = strtol(arg4, NULL, 10);
- LPITEM item = ITEM_MANAGER::instance().Find(item_id);
- if (item == NULL)
- return;
- AuctionManager::instance().enroll_auction(ch, item, empire, bidPrice, immidiatePurchasePrice);
- }
- ACMD(do_enroll_wish)
- {
- char arg1[256];
- char arg2[256];
- char arg3[256];
- one_argument (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3));
- DWORD item_num = strtoul(arg1, NULL, 10);
- BYTE empire = strtoul(arg2, NULL, 10);
- int wishPrice = strtol(arg3, NULL, 10);
- AuctionManager::instance().enroll_wish(ch, item_num, empire, wishPrice);
- }
- ACMD(do_enroll_sale)
- {
- char arg1[256];
- char arg2[256];
- char arg3[256];
- one_argument (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3));
- DWORD item_id = strtoul(arg1, NULL, 10);
- DWORD wisher_id = strtoul(arg2, NULL, 10);
- int salePrice = strtol(arg3, NULL, 10);
- LPITEM item = ITEM_MANAGER::instance().Find(item_id);
- if (item == NULL)
- return;
- AuctionManager::instance().enroll_sale(ch, item, wisher_id, salePrice);
- }
- // temp_auction
- // packetہ¸·خ إë½إاد°ش اد°ي, ہج°ا »èء¦اط¾كار´ظ.
- ACMD(do_get_auction_list)
- {
- char arg1[256];
- char arg2[256];
- char arg3[256];
- two_arguments (one_argument (argument, arg1, sizeof(arg1)), arg2, sizeof(arg2), arg3, sizeof(arg3));
- AuctionManager::instance().get_auction_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10), strtoul(arg3, NULL, 10));
- }
- //
- //ACMD(do_get_wish_list)
- //{
- // char arg1[256];
- // char arg2[256];
- // char arg3[256];
- // two_arguments (one_argument (argument, arg1, sizeof(arg1)), arg2, sizeof(arg2), arg3, sizeof(arg3));
- //
- // AuctionManager::instance().get_wish_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10), strtoul(arg3, NULL, 10));
- //}
- ACMD (do_get_my_auction_list)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().get_my_auction_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_get_my_purchase_list)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().get_my_purchase_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_auction_bid)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().bid (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_auction_impur)
- {
- char arg1[256];
- one_argument (argument, arg1, sizeof(arg1));
- AuctionManager::instance().immediate_purchase (ch, strtoul(arg1, NULL, 10));
- }
- ACMD (do_get_auctioned_item)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().get_auctioned_item (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_buy_sold_item)
- {
- char arg1[256];
- char arg2[256];
- one_argument (argument, arg1, sizeof(arg1));
- AuctionManager::instance().get_auctioned_item (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_cancel_auction)
- {
- char arg1[256];
- one_argument (argument, arg1, sizeof(arg1));
- AuctionManager::instance().cancel_auction (ch, strtoul(arg1, NULL, 10));
- }
- ACMD (do_cancel_wish)
- {
- char arg1[256];
- one_argument (argument, arg1, sizeof(arg1));
- AuctionManager::instance().cancel_wish (ch, strtoul(arg1, NULL, 10));
- }
- ACMD (do_cancel_sale)
- {
- char arg1[256];
- one_argument (argument, arg1, sizeof(arg1));
- AuctionManager::instance().cancel_sale (ch, strtoul(arg1, NULL, 10));
- }
- ACMD (do_rebid)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().rebid (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
- }
- ACMD (do_bid_cancel)
- {
- char arg1[256];
- char arg2[256];
- two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
- AuctionManager::instance().bid_cancel (ch, strtoul(arg1, NULL, 10));
- }
- #endif
- #ifdef ENABLE_DS_CHANGE_ATTR
- ACMD(do_ds_change_attr)
- {
- char arg1[256];
- one_argument(argument, arg1, sizeof(arg1));
- if (!*arg1)
- return;
- if (ch->GetExchange() || ch->GetMyShop() || ch->GetShopOwner() || ch->IsOpenSafebox() || ch->IsCubeOpen()) {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¢¥U¢¬،ح ،ئA،¤¢®A،ثAI ¢¯¢¬،ئ،يoAA¢¯¢®¨ù¢¥A ،يoA¢®،ئA،¤¢®¢¬| CO¨ùo ،ئ¢® ¨ْ©ھ¨ِA¢¥I¢¥U."));
- return;
- }
- DWORD dwPos = 0;
- str_to_number(dwPos, arg1);
- // M K L B E
- const BYTE needFireCountList[] = { 1, 3, 9, 27, 81 };
- BYTE bNeedFire = -1;
- if (dwPos < 0 || dwPos >= DRAGON_SOUL_INVENTORY_MAX_NUM)
- return;
- LPITEM item = ch->GetItem(TItemPos(DRAGON_SOUL_INVENTORY, dwPos));
- if (!item || item->IsExchanging() || item->IsEquipped())
- return;
- if (item->IsDragonSoul()) {
- bNeedFire = needFireCountList[(item->GetVnum() / 100) % 10];
- if (bNeedFire != -1) {
- if (DSManager::instance().IsActiveDragonSoul(item) == true)
- {
- //ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CANNOT_CHANGE_BONUS_OF_EQUIPPED_DRAGON_SOUL_ITEM"));
- return;
- }
- if (!ch->CountSpecifyItem(100700) >= bNeedFire)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CANNOT_CHANGE_BONUS_YOU_HAVE_NOT_ENOUGH_FLAMES"));
- return;
- }
- bool ret2 = DSManager::instance().PutAttributes2(item);
- if (!ret2 == true)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This Dragon Stone Bonus cannot be changed."));
- return;
- }
- if (ch->CountSpecifyItem(100700) >= bNeedFire)
- {
- for (BYTE i=0;i < 6;i++)
- {
- item->SetForceAttribute(i, 0, 0);
- }
- }
- if (ch->CountSpecifyItem(100700) >= bNeedFire)
- {
- bool ret = DSManager::instance().PutAttributes2(item);
- if (ch->GetGold() < 500000)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("YOU_DONT_HAVE_ENOUGH_MONEY"));
- return;
- }
- else
- {
- ch->PointChange(POINT_GOLD, -500000);
- }
- if (ret == true)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("SUCCESSFULLY_CHANGED_BONUS_OF_DRAGON_SOUL_ITEM"));
- ch->RemoveSpecifyItem(100700, bNeedFire);
- // DSManager::instance().PutAttributes2(item);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "DS_ChangeAttr_Success");
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("FAILED_CHANGING_BONUS_OF_DRAGON_SOUL_ITEM"));
- ch->ChatPacket(CHAT_TYPE_COMMAND, "DS_ChangeAttr_Failed");
- }
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CANNOT_CHANGE_BONUS_YOU_HAVE_NOT_ENOUGH_FLAMES"));
- return;
- }
- // for (BYTE i=0;i < 6;i++) { item->SetForceAttribute(i, 0, 0); }
- }
- }
- }
- #endif
- #ifdef ENABLE_BATTLE_PASS
- ACMD(open_battlepass)
- {
- if (ch->v_counts.empty())
- return;
- if (ch->missions_bp.empty())
- return;
- if (ch->GetExchange() || ch->GetMyShop() || ch->IsOpenSafebox() || ch->IsCubeOpen() || ch->IsCombOpen() || ch->IsOpenMailBox() || ch->isSashOpened(true) || ch->isSashOpened(false) || ch->isChangeLookOpened())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "<BP> Lutfen aktif pencereleri kapatiniz");
- return;
- }
- time_t cur_Time = time(NULL);
- struct tm vKey = *localtime(&cur_Time);
- int month = vKey.tm_mon;
- if (month != ch->iMonthBattlePass)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Zaman gecmis!");
- return;
- }
- for (int i = 0; i<ch->missions_bp.size(); ++i)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "missions_bp %d %d %d %d", i, ch->missions_bp[i].type, ch->missions_bp[i].vnum, ch->missions_bp[i].count);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "info_missions_bp %d %d %d %s", i, ch->v_counts[i].count, ch->v_counts[i].status, ch->rewards_bp[i].name);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "rewards_missions_bp %d %d %d %d %d %d %d", i, ch->rewards_bp[i].vnum1, ch->rewards_bp[i].vnum2, ch->rewards_bp[i].vnum3, ch->rewards_bp[i].count1, ch->rewards_bp[i].count2, ch->rewards_bp[i].count3);
- }
- ch->ChatPacket(CHAT_TYPE_COMMAND, "size_missions_bp %d ", ch->missions_bp.size());
- ch->ChatPacket(CHAT_TYPE_COMMAND, "final_reward %d %d %d %d %d %d", ch->final_rewards[0].f_vnum1, ch->final_rewards[0].f_vnum2, ch->final_rewards[0].f_vnum3, ch->final_rewards[0].f_count1, ch->final_rewards[0].f_count2, ch->final_rewards[0].f_count3);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "show_battlepass");
- }
- ACMD(final_reward_battlepass)
- {
- if (ch->v_counts.empty())
- return;
- if (ch->missions_bp.empty())
- return;
- if (ch->v_counts[0].status == 2)
- return;
- if (ch->GetExchange() || ch->GetMyShop() || ch->IsOpenSafebox() || ch->IsCubeOpen() || ch->IsCombOpen() || ch->IsOpenMailBox() || ch->isSashOpened(true) || ch->isSashOpened(false) || ch->isChangeLookOpened())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "<BP> Lutfen aktif pencereleri kapatiniz");
- return;
- }
- time_t cur_Time = time(NULL);
- struct tm vKey = *localtime(&cur_Time);
- int month = vKey.tm_mon;
- if (month != ch->iMonthBattlePass)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Zaman gecmis!");
- return;
- }
- for (int i = 0; i<ch->missions_bp.size(); ++i)
- {
- if (ch->missions_bp[i].count != ch->v_counts[i].count)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "Gorev daha bitmemis, goreve devam edebilirsiniz!");
- return;
- }
- }
- ch->FinalRewardBattlePass();
- }
- #endif
- #ifdef WJ_ELDER_ATTRIBUTE_SYSTEM
- ACMD(do_add_new_attribute)
- {
- std::vector<std::string> vecArgs;
- split_argument(argument,vecArgs);
- if (vecArgs.size() < 7)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_UNKNOWN_ARGUMENT"));
- return;
- }
- int sourceItemPos, targetItemPos, attrtype0, attrtype1, attrtype2, attrtype3, attrtype4;
- // int targetItemPos;
- // int attrtype0;
- // int attrtype1;
- // int attrtype2;
- // int attrtype3;
- str_to_number(sourceItemPos, vecArgs[1].c_str());
- str_to_number(targetItemPos, vecArgs[2].c_str());
- str_to_number(attrtype0, vecArgs[3].c_str());
- str_to_number(attrtype1, vecArgs[4].c_str());
- str_to_number(attrtype2, vecArgs[5].c_str());
- str_to_number(attrtype3, vecArgs[6].c_str());
- str_to_number(attrtype4, vecArgs[7].c_str());
- LPITEM item = ch->GetInventoryItem(targetItemPos);
- if (!item)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_CANNOT_FIND_ITEM"));
- return;
- }
- if (item->GetType() != ITEM_WEAPON && item->GetType() != ITEM_ARMOR)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_COSTUME"));
- return;
- }
- if (item->IsEquipped())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EQUIPPED"));
- return;
- }
- if (item->IsExchanging())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EXCHANGING"));
- return;
- }
- if (ch->CountSpecifyItem(71051) < 1)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ENOUGH_NEW_ATTRIBUTE"));
- return;
- }
- TItemTable const * pProto = item->GetProto();
- bool addontype = false;
- if (pProto && pProto->sAddonType)
- addontype = true;
- int attrtype0prob = number(1,5), attrtype1prob = number(1,5), attrtype2prob = number(1,5), attrtype3prob = number(1,5), attrtype4prob = number(1,5);
- // int attrtype1prob = number(1,5)
- // int attrtype2prob = number(1,5);
- // int attrtype3prob = number(1,5);
- bool error = false;
- if (addontype == false)
- {
- if (attrtype0 == attrtype1 || attrtype0 == attrtype2 || attrtype0 == attrtype3 || attrtype0 == item->GetAttributeType(5))
- error = true;
- if (attrtype1 == attrtype0 || attrtype1 == attrtype2 || attrtype1 == attrtype3 || attrtype1 == item->GetAttributeType(5))
- error = true;
- if (attrtype2 == attrtype0 || attrtype2 == attrtype0 || attrtype2 == attrtype3 || attrtype2 == item->GetAttributeType(5))
- error = true;
- if (attrtype3 == attrtype0 || attrtype3 == attrtype1 || attrtype3 == attrtype2 || attrtype3 == item->GetAttributeType(5))
- error = true;
- if (attrtype4 == attrtype0 || attrtype4 == attrtype1 || attrtype4 == attrtype2 || attrtype4 == item->GetAttributeType(5))
- error = true;
- if (item->GetAttributeType(5) == attrtype0 || item->GetAttributeType(5) == attrtype1 || item->GetAttributeType(5) == attrtype2 || item->GetAttributeType(5) == attrtype3 || item->GetAttributeType(5) == attrtype4)
- error = true;
- }
- else
- {
- if (attrtype0 == attrtype1 || attrtype0 == item->GetAttributeType(5))
- error = true;
- if (attrtype1 == attrtype0 || attrtype1 == item->GetAttributeType(5))
- error = true;
- }
- for (int i=0; i < 5; ++i)
- {
- if (addontype == false)
- {
- if (item->GetAttributeType(i) == attrtype0 && i != 0)
- error = true;
- if (item->GetAttributeType(i) == attrtype1 && i != 1)
- error = true;
- if (item->GetAttributeType(i) == attrtype2 && i != 2)
- error = true;
- if (item->GetAttributeType(i) == attrtype3 && i != 3)
- error = true;
- if (item->GetAttributeType(i) == attrtype4 && i != 4)
- error = true;
- }
- else
- {
- if (item->GetAttributeType(i+2) == attrtype0 && i != 0)
- error = true;
- if (item->GetAttributeType(i+2) == attrtype1 && i != 1)
- error = true;
- }
- }
- if (error)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ERROR"));
- return;
- }
- if (addontype == false)
- {
- item->AddNewAttr(0, attrtype0, attrtype0prob);
- item->AddNewAttr(1, attrtype1, attrtype1prob);
- item->AddNewAttr(2, attrtype2, attrtype2prob);
- item->AddNewAttr(3, attrtype3, attrtype3prob);
- item->AddNewAttr(4, attrtype4, attrtype4prob);
- }
- else
- {
- int oldattr5type = item->GetAttributeType(5), oldattr5value = item->GetAttributeValue(5);
- // int oldattr5value = item->GetAttributeValue(4);
- item->RemoveAttributeAt(0);
- item->RemoveAttributeAt(1);
- item->ApplyAddon(100);
- item->ChangeAttribute();
- item->AddNewAttr(2, attrtype0, attrtype0prob);
- item->AddNewAttr(3, attrtype1, attrtype1prob);
- item->AddNewAttr(4, oldattr5type, oldattr5value);
- if (item->GetAttributeType(1) != 71)
- {
- if (item->GetAttributeType(0) != 72)
- {
- item->SetForceAttribute(0, 72, 13);
- item->SetForceAttribute(1, 71, 1);
- }
- else
- item->SetForceAttribute(1, 71, -1);
- }
- }
- ch->RemoveSpecifyItem(71051, 1);
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_SUCCESS_ATTR"));
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement