吾爱尚玩资源基地
标题:
MANGOS-TBC版本的测试运气的系统-得到金币或则物品
[打印本页]
作者:
admin
时间:
2016-4-20 22:54
标题:
MANGOS-TBC版本的测试运气的系统-得到金币或则物品
diff -Nuar oregoncore-current/src/game/Chat.cpp oregoncore-pq/src/game/Chat.cpp--- oregoncore-current/src/game/Chat.cpp 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Chat.cpp 2011-01-01 10:12:14.000000000 -0500
@@ -663,6 +663,11 @@
{ "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
{ "playall", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
{ "repairitems", SEC_GAMEMASTER, false, &ChatHandler::HandleRepairitemsCommand, "", NULL },
+
+ //Allows your players to gamble for fun and prizes
+ { "gamble", SEC_PLAYER, false, &ChatHandler::HandleGambleCommand, "", NULL },
+ { "roulette", SEC_PLAYER, false, &ChatHandler::HandleRouletteCommand, "", NULL },
+
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
{ "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
{ "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
diff -Nuar oregoncore-current/src/game/Chat.h oregoncore-pq/src/game/Chat.h
--- oregoncore-current/src/game/Chat.h 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Chat.h 2011-01-01 10:12:14.000000000 -0500
@@ -357,6 +357,10 @@
bool HandleUnFreezeCommand(const char *args);
bool HandleListFreezeCommand(const char* args);
+ //Gamble
+ bool HandleRouletteCommand(const char* args);
+ bool HandleGambleCommand(const char* args);
+
bool HandleBanAccountCommand(const char* args);
bool HandleBanCharacterCommand(const char* args);
bool HandleBanIPCommand(const char* args);
diff -Nuar oregoncore-current/src/game/Level0.cpp oregoncore-pq/src/game/Level0.cpp
--- oregoncore-current/src/game/Level0.cpp 2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Level0.cpp 2011-01-01 10:12:14.000000000 -0500
@@ -88,6 +88,80 @@
chr->CastSpell(chr,7355,false);
return true;
}
+//Allows your players to gamble for fun and prizes
+bool ChatHandler::HandleGambleCommand(const char* args)
+{
+ Player *chr = m_session->GetPlayer();
+
+ char* px = strtok((char*)args, " ");
+
+ if (!px)
+ return false;
+
+ uint32 money = (uint32)atoi(px);
+
+ if (chr->GetMoney() < money)
+ {
+ SendSysMessage("You can not bet with money you do not have!");
+ return true;
+ }
+
+ else
+ {
+ if (money>0)
+ {
+ if (rand()%100 < 50)
+ {
+ chr->ModifyMoney(money*2);
+ SendSysMessage("You have won and doubled your bet");
+ }
+ else
+ {
+ chr->ModifyMoney(-int(money));
+ SendSysMessage("You have lost");
+ }
+ }
+ }
+
+ return true;
+}
+
+bool ChatHandler::HandleRouletteCommand(const char* args)
+{
+ Player *chr = m_session->GetPlayer();
+
+ char* px = strtok((char*)args, " ");
+
+ if (!px)
+ return false;
+
+ uint32 money = (uint32)atoi(px);
+
+ if (chr->GetMoney() < money)
+ {
+ SendSysMessage("You can not bet with money you do not have!");
+ return true;
+ }
+
+ else
+ {
+ if (money>0)
+ {
+ if (rand()%36 < 1)
+ {
+ chr->ModifyMoney(money*36);
+ SendSysMessage("You have won 36 times your bet, congratulations!");
+ }
+ else
+ {
+ chr->ModifyMoney(-int(money));
+ SendSysMessage("You have lost");
+ }
+ }
+ }
+
+ return true;
+ }
bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
{
回复下载完整代码
作者:
wjfh123
时间:
2021-4-1 02:07
支持吾爱尚玩,依照《金币》快速获取指南,即可获得金币免费下载游戏!
作者:
2244650069
时间:
2021-9-2 20:22
支持吾爱尚玩,依照《金币》快速获取指南,即可获得金币免费下载游戏!
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4