Távoli kereskedés

Indította OneCharakter, 2019-09-10, 20:51:44

2019-09-10, 20:51:44 Utolsó szerkesztés: 2019-09-10, 20:58:10 Szerző: OneCharakter
Sziasztok ez egy low tut hogyan is oldjuk a meg a szerveren való távoli kereskedés-t.

exchange.cpp

keresd meg:

if (iDist >= EXCHANGE_MAX_DISTANCE)
return false;


kommenteld ki:

/*if (iDist >= EXCHANGE_MAX_DISTANCE)
return false;*/

cmd.cpp

keresd meg:

ACMD(do_user_horse_feed);

alá:
ACMD(do_transfer_exchange);

keresd meg:

{ "user_horse_feed", do_user_horse_feed, 0, POS_FISHING, GM_PLAYER },

alá:

{ "kereskedes", do_transfer_exchange, 0, POS_FISHING, GM_PLAYER },

cmd_general.cpp

keresd meg:

ACMD(do_user_horse_ride)

ez felé ! :

ACMD(do_transfer_exchange)
{
char arg1[256];

const char*  Name;

one_argument(argument, arg1, sizeof(arg1));

if (!*arg1)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Invalid Syntax, usage: <player name>");
return;
}

Name = arg1;

LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(Name);

if (!tch)
{
ch->ChatPacket(CHAT_TYPE_INFO, "%s nincs játékban.", Name);
return;
}

if (!tch->GetDesc())
{
return;
}

if (!ch)
{
ch->ChatPacket(CHAT_TYPE_INFO, "%s nincs játékban", ch->GetName());
return;
}

if (ch)
{
ch->ExchangeStart(tch);
}
}


root/game.py

keresd meg:

onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)

alá:

(f5 de változtasd ha kell/akarod)

onPressKeyDict[app.DIK_F5] = lambda : self.ClickExchangeN()

keresd meg :

def __LoverDivorce(self):
if self.interface.wndMessenger:
self.interface.wndMessenger.ClearLoverInfo()
if self.affectShower:
self.affectShower.ClearLoverState()


alá:

def ClickExchangeN(self):
excahnge_n = uiCommon.InputDialog()
excahnge_n.SetTitle("Távoli kereskedés [Név:]")
excahnge_n.SetAcceptEvent(ui.__mem_func__(self.AddNameEx))
excahnge_n.SetCancelEvent(ui.__mem_func__(self.OnCancelNameEx))
excahnge_n.Open()
self.excahnge_n = excahnge_n

def AddNameEx(self):
charactername = self.excahnge_n.GetText()
if charactername:
net.SendChatPacket("/kereskedes " + str(charactername))
self.excahnge_n.Close()
self.excahnge_n = None
return True

def OnCancelNameEx(self):
self.excahnge_n.Close()
self.excahnge_n = None
return True