Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dodaj na samym dole pliku:
- void CHARACTER::ChannelSwitch(int iNewChannel)
- {
- long lAddr, lMapIndex;
- WORD wPort;
- long x = GetX();
- long y = GetY();
- /*
- if (OffShopBug > get_global_time())
- {
- ChatPacket(CHAT_TYPE_INFO, "Poczekaj 10 sekund!");
- return;
- }
- */
- if (!CMapLocation::Instance().Get(x, y, lMapIndex, lAddr, wPort))
- {
- sys_err("Can not find map location index[%ld] x[%ld] y[%ld] name[%s]", lMapIndex, x, y, GetName());
- return;
- }
- if (g_bChannel == iNewChannel)
- {
- ChatPacket(CHAT_TYPE_INFO, "[Neshalie] Nie mozesz przeniesc sie na ten sam kanał!");
- return;
- }
- if (g_bChannel == 99)
- {
- ChatPacket(CHAT_TYPE_INFO, "[Neshalie] Tutaj nie mozna zmienic kanału!");
- return;
- }
- if (GetDungeon())
- {
- ChatPacket(CHAT_TYPE_INFO, "[Neshalie] Niestety na dungeonie nie mozna zmienic kanału!");
- return;
- }
- if (lMapIndex >= 10000)
- return;
- if (!g_bChannel || g_bChannel == 0)
- {
- return;
- }
- BYTE podch = 0;
- WORD malpa = 0;
- if (wPort == 15100 || wPort == 15200 || wPort == 15300 || wPort == 15400)
- {
- podch = 1;
- }
- else if (wPort == 15101 || wPort == 15201 || wPort == 15301 || wPort == 15401)
- {
- podch = 2;
- }
- else if (wPort == 15102 || wPort == 15202 || wPort == 15302 || wPort == 15402)
- {
- podch = 3;
- }
- else if (wPort == 15103 || wPort == 15203 || wPort == 15303 || wPort == 15403)
- {
- podch = 4;
- }
- else
- {
- podch = 0;
- }
- Stop();
- Save();
- if (GetSectree())
- {
- GetSectree()->RemoveEntity(this);
- ViewCleanup();
- EncodeRemovePacket(this);
- }
- if (podch == 1)
- {
- malpa = 15000 + 100 * iNewChannel;
- podch = 0;
- }
- else if (podch == 2)
- {
- malpa = 15001 + 100 * iNewChannel;
- podch = 0;
- }
- else if (podch == 3)
- {
- malpa = 15002 + 100 * iNewChannel;
- podch = 0;
- }
- else if (podch == 4)
- {
- malpa = 15003 + 100 * iNewChannel;
- podch = 0;
- }
- else
- {
- malpa = 15000 + 100 * iNewChannel;
- }
- TPacketGCWarp p;
- p.bHeader = HEADER_GC_WARP;
- p.lX = x;
- p.lY = y;
- p.lAddr = lAddr;
- p.wPort = malpa;
- GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement