okay kártya

Indította Levi999, 2017-02-16, 13:30:18

sziasztok valaki tudna adni egy okay kártya txt portot ?

ez alapján raktam be http://www.freakgamers.org/threads/mega-release-c-lua-py-new-gameforge-event-okay-cards.4132/

és valaki annyiba tudna segíteni hogy kártya asztal hoz kel e npc_list? vagy sem mert az nincs mellékelve sajna :( vagy az nem is kel hozzá?

Mi az a port?
Az ember csak fiatalon találhat ki igazán új dolgokat. Utána már túl tapasztalt, túl híres (...) és túl ostoba.

2017-02-16, 16:14:51 #2 Utolsó szerkesztés: 2017-02-16, 16:17:51 Szerző: Levi999
el van írva problémád van  vele gyere privátba és ne ide szemetelj.  ha nem tudsz segíteni sodrófanak írsz témába értelmes ember nem ír bele

Ha, kicsit lefele tekered írnak txt protot.

79505 Okey-Sammelkarte
79506 Okey-Kartenset
71194 Goldene Okey-Box
71195 Silberne Okey-Box
71196 Bronzene Okey-Box


79505 Okey-Sammelkarte ITEM_SPECIAL SPECIAL_MAP 1 NONE ITEM_STACKABLE NONE 7500 7500 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0
79506 Okey-Kartenset ITEM_SPECIAL SPECIAL_MAP 1 NONE NONE NONE 3000 3000 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0
71194 Goldene Okey-Box ITEM_GIFTBOX 0 1 ANTI_DROP | ANTI_SELL | ANTI_STACK ITEM_STACKABLE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0
71195 Silberne Okey-Box ITEM_GIFTBOX 0 1 ANTI_DROP | ANTI_SELL | ANTI_STACK ITEM_STACKABLE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0
71196 Bronzene Okey-Box ITEM_GIFTBOX 0 1 ANTI_DROP | ANTI_SELL | ANTI_STACK ITEM_STACKABLE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0

csak hogy hiába vagyok regelve nem adja ki

köszönöm neked.

asztalhoz szerinted kel npc_list vagy aszt simán be ólvasa? mert npc listes rész nincs meg adva ahogy ládtam vagy ez fix terep tárgy lenne szerinted?

kell hozzá npc list mivel npc ha fix tereptárgy lenne akkor a zonbe-ba kéne rakni meg ilyenek ;)

A patch fájlokba van neki külön npc a ranglista miatt mert, azt olvassa csak npc-ről de, teheted akár másik npc-re is.

2017-02-16, 19:24:38 #7 Utolsó szerkesztés: 2017-02-16, 19:38:17 Szerző: Levi999
rendben köszi szépen Red

de ez skorpió

erre írja a hibát de hát kérem szépen jónak kéne legyen

int pc_get_okay_global_rank(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (!ch)
return 0;


char szBuf[4096+1];
ch->GetGlobalRank(szBuf, sizeof(szBuf));
lua_pushstring(L, szBuf);
return 1;
}

int pc_get_okay_rund_rank(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
if (!ch)
return 0;


char szBuf[4096+1];
ch->GetRundRank(szBuf, sizeof(szBuf));
lua_pushstring(L, szBuf);
return 1;
}


ezzel most mi a problémája fordítónak?

58-82 ig van be téve

itt van nutepad++ kép is hozzá

mi lehet a probléma itt?

Ezt a char_cards.cpp-t használod?
Azt sem látom, hogy a makefile-ben hozzá lenne adva a char_cards.cpp.

#include "stdafx.h"
#include "char.h"
#include "utils.h"
#include "log.h"
#include "db.h"
#include "dev_log.h"
#include "locale_service.h"
#include <stdlib.h>
#include <sstream>
#include "config.h"
#include "desc.h"
#include "desc_manager.h"
#include "char_manager.h"
#include "item.h"
#include "item_manager.h"
#include "buffer_manager.h"
#include "packet.h"
#include "questmanager.h"
#include "monarch.h"
#include "mob_manager.h"
#include "desc_client.h"
#include "group_text_parse_tree.h"
#include <boost/algorithm/string/predicate.hpp>
#include <cctype>
#include "p2p.h"
#include "entity.h"
#include "sectree_manager.h"

void CHARACTER::Cards_open(DWORD safemode)
{
if (GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsAcceOpen())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´Ů¸Ą °Ĺ·ˇÁß(â°í,±łČŻ,»óÁˇ)żˇ´Â »çżëÇŇ Ľö ľř˝Ŕ´Ď´Ů."));
return;
}
if (character_cards.cards_left <= 0)
{
if (GetGold() < 30000)
{
ChatPacket(CHAT_TYPE_INFO, "You dont have enough money.");
return;
}
if (CountSpecifyItem(79506) < 1)
{
ChatPacket(CHAT_TYPE_INFO, "You dont have any cardsets.");
return;
}
PointChange(POINT_GOLD, -30000, true);
RemoveSpecifyItem(79506, 1);
Cards_clean_list();
character_cards.cards_left = 24;
}
ChatPacket(CHAT_TYPE_COMMAND, "cards open %d", safemode);
SendUpdatedInformations();
}

void CHARACTER::Cards_clean_list()
{
memset(&character_cards, 0, sizeof(character_cards));
memset(&randomized_cards, 0, sizeof(randomized_cards));
}

DWORD CHARACTER::GetEmptySpaceInHand()
{
for (int i=0; i<MAX_CARDS_IN_HAND; ++i)
{
if (character_cards.cards_in_hand[i].type == 0)
return i;
}
return -1;
}

void CHARACTER::Cards_pullout()
{
DWORD empty_space = GetEmptySpaceInHand();
if (empty_space == -1)
{
ChatPacket(CHAT_TYPE_INFO, "You dont have space in hands.");
return;
}
if (character_cards.cards_left < 1)
{
ChatPacket(CHAT_TYPE_INFO, "You dont have cards.");
return;
}
if (GetAllCardsCount() >= 5)
{
ChatPacket(CHAT_TYPE_INFO, "You dont have space on table.");
return;
}
RandomizeCards();
SendUpdatedInformations();
}

void CHARACTER::RandomizeCards()
{
DWORD card_type = number(1, 3);
DWORD card_value = number(1, 8);
if (CardWasRandomized(card_type, card_value) != false)
{
RandomizeCards();
}
else
{
DWORD empty_space = GetEmptySpaceInHand();
character_cards.cards_in_hand[empty_space].type = card_type;
character_cards.cards_in_hand[empty_space].value = card_value;
character_cards.cards_left -= 1;
}
}

bool CHARACTER::CardWasRandomized(DWORD type, DWORD value)
{
for (int i=0; i<24; ++i)
{
if (randomized_cards[i].type == type && randomized_cards[i].value == value)
{
return true;
}
}
for (int i=0; i<24; ++i)
{
if (randomized_cards[i].type == 0)
{
randomized_cards[i].type = type;
randomized_cards[i].value = value;
return false;
}
}
return false;
}

void CHARACTER::SendUpdatedInformations()
{
ChatPacket(CHAT_TYPE_COMMAND, "cards info %d %d %d %d %d %d %d %d %d %d %d %d", character_cards.cards_in_hand[0].type, character_cards.cards_in_hand[0].value,
character_cards.cards_in_hand[1].type, character_cards.cards_in_hand[1].value, character_cards.cards_in_hand[2].type,
character_cards.cards_in_hand[2].value, character_cards.cards_in_hand[3].type, character_cards.cards_in_hand[3].value,
character_cards.cards_in_hand[4].type, character_cards.cards_in_hand[4].value,
character_cards.cards_left, character_cards.points);

ChatPacket(CHAT_TYPE_COMMAND, "cards finfo %d %d %d %d %d %d %d", character_cards.cards_in_field[0].type, character_cards.cards_in_field[0].value, character_cards.cards_in_field[1].type,
character_cards.cards_in_field[1].value, character_cards.cards_in_field[2].type, character_cards.cards_in_field[2].value,
character_cards.field_points);
}

void CHARACTER::SendReward()
{
ChatPacket(CHAT_TYPE_COMMAND, "cards reward %d %d %d %d %d %d %d", character_cards.cards_in_field[0].type, character_cards.cards_in_field[0].value, character_cards.cards_in_field[1].type,
character_cards.cards_in_field[1].value, character_cards.cards_in_field[2].type, character_cards.cards_in_field[2].value,
character_cards.field_points);
}

void CHARACTER::CardsDestroy(DWORD reject_index)
{
if (reject_index + 1 > MAX_CARDS_IN_HAND)
return;
if (character_cards.cards_in_hand[reject_index].type == 0)
return;
character_cards.cards_in_hand[reject_index].type = 0;
character_cards.cards_in_hand[reject_index].value = 0;
SendUpdatedInformations();
}

void CHARACTER::CardsAccept(DWORD accept_index)
{
if (accept_index + 1 > MAX_CARDS_IN_HAND)
return;
if (character_cards.cards_in_hand[accept_index].type == 0)
return;
DWORD empty_space = GetEmptySpaceInField();
if (empty_space != -1)
{
character_cards.cards_in_field[empty_space].type = character_cards.cards_in_hand[accept_index].type;
character_cards.cards_in_field[empty_space].value = character_cards.cards_in_hand[accept_index].value;
character_cards.cards_in_hand[accept_index].type = 0;
character_cards.cards_in_hand[accept_index].value = 0;
}
if (GetEmptySpaceInField() == -1)
{
if (CheckReward())
{
SendReward();
ResetField();
}
else
{
RestoreField();
}
}
SendUpdatedInformations();
}

void CHARACTER::CardsRestore(DWORD restore_index)
{
if (restore_index + 1 > MAX_CARDS_IN_FIELD)
return;
if (character_cards.cards_in_field[restore_index].type == 0)
return;
DWORD empty_space = GetEmptySpaceInHand();
character_cards.cards_in_hand[empty_space].type = character_cards.cards_in_field[restore_index].type;
character_cards.cards_in_hand[empty_space].value = character_cards.cards_in_field[restore_index].value;
character_cards.cards_in_field[restore_index].type = 0;
character_cards.cards_in_field[restore_index].value = 0;
SendUpdatedInformations();
}

DWORD CHARACTER::GetEmptySpaceInField()
{
for (int i=0; i<MAX_CARDS_IN_FIELD; ++i)
{
if (character_cards.cards_in_field[i].type == 0)
return i;
}
return -1;
}

DWORD CHARACTER::GetAllCardsCount()
{
DWORD count = 0;
for (int i=0; i<MAX_CARDS_IN_HAND; ++i)
{
if (character_cards.cards_in_hand[i].type != 0)
count += 1;
}
for (int i=0; i<MAX_CARDS_IN_FIELD; ++i)
{
if (character_cards.cards_in_field[i].type != 0)
count += 1;
}
return count;
}
bool CHARACTER::TypesAreSame()
{
if (character_cards.cards_in_field[0].type == character_cards.cards_in_field[1].type && character_cards.cards_in_field[1].type == character_cards.cards_in_field[2].type)
return true;
return false;
}

bool CHARACTER::ValuesAreSame()
{
if (character_cards.cards_in_field[0].value == character_cards.cards_in_field[1].value && character_cards.cards_in_field[1].value == character_cards.cards_in_field[2].value)
return true;
return false;
}

bool CHARACTER::CardsMatch()
{
if (character_cards.cards_in_field[0].value == character_cards.cards_in_field[1].value - 1 && character_cards.cards_in_field[1].value == character_cards.cards_in_field[2].value -1)
return true;
else if (character_cards.cards_in_field[0].value == character_cards.cards_in_field[2].value - 1 && character_cards.cards_in_field[2].value == character_cards.cards_in_field[1].value -1)
return true;
else if (character_cards.cards_in_field[1].value == character_cards.cards_in_field[0].value - 1 && character_cards.cards_in_field[0].value == character_cards.cards_in_field[2].value -1)
return true;
else if (character_cards.cards_in_field[0].value == character_cards.cards_in_field[1].value - 1 && character_cards.cards_in_field[2].value == character_cards.cards_in_field[0].value -1)
return true;
else if (character_cards.cards_in_field[1].value == character_cards.cards_in_field[0].value - 1 && character_cards.cards_in_field[2].value == character_cards.cards_in_field[1].value -1)
return true;
else if (character_cards.cards_in_field[1].value == character_cards.cards_in_field[2].value - 1 && character_cards.cards_in_field[2].value == character_cards.cards_in_field[0].value -1)
return true;
else
return false;
}

DWORD CHARACTER::GetLowestCard()
{
return MIN(character_cards.cards_in_field[0].value, MIN(character_cards.cards_in_field[1].value, character_cards.cards_in_field[2].value));
}
bool CHARACTER::CheckReward()
{
if (TypesAreSame() && ValuesAreSame())
{
character_cards.field_points = 150;
character_cards.points += 150;
return true;
}
else if (TypesAreSame() && CardsMatch())
{
character_cards.field_points = 100;
character_cards.points += 100;
return true;
}
else if (ValuesAreSame())
{
character_cards.field_points = GetLowestCard()*10+10;
character_cards.points += GetLowestCard()*10+10;
return true;
}
else if (CardsMatch())
{
character_cards.field_points = GetLowestCard()*10;
character_cards.points += GetLowestCard()*10;
return true;
}
else
{
RestoreField();
return false;
}
}

void CHARACTER::RestoreField()
{
for (int i=0; i<MAX_CARDS_IN_FIELD; ++i)
{
DWORD empty_space = GetEmptySpaceInHand();
character_cards.cards_in_hand[empty_space].type = character_cards.cards_in_field[i].type;
character_cards.cards_in_hand[empty_space].value = character_cards.cards_in_field[i].value;
character_cards.cards_in_field[i].type = 0;
character_cards.cards_in_field[i].value = 0;
SendUpdatedInformations();
}
}

void CHARACTER::ResetField()
{
for (int i=0; i<MAX_CARDS_IN_FIELD; ++i)
{
character_cards.cards_in_field[i].type = 0;
character_cards.cards_in_field[i].value = 0;
}
}

void CHARACTER::CardsEnd()
{
if (character_cards.points >= 400)
AutoGiveItem(71194); //Golden box
else if (character_cards.points < 400 && character_cards.points >= 250)
AutoGiveItem(71195); //Silver box
else if (character_cards.points > 0)
AutoGiveItem(71196); //Bronze box
LogManager::instance().OkayEventLog(GetPlayerID(), GetName(), character_cards.points);
Cards_clean_list();
SendUpdatedInformations();
}

void CHARACTER::GetGlobalRank(char * buffer, size_t buflen)
{
std::auto_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery("SELECT name, SUM(points) as spoints FROM log.okay_event GROUP BY pid ORDER BY spoints DESC LIMIT 10"));
if (pMsg->Get()->uiNumRows == 0)
{
return;
}

MYSQL_ROW row;
int pos = 1;
int len = 0, len2;
*buffer = '\0';
while (NULL != (row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
{
int points = 0;
str_to_number(points, row[1]);
len2 = snprintf(buffer + len, buflen - len, "[ENTER]");

if (len2 < 0 || len2 >= (int) buflen - len)
len += (buflen - len) - 1;
else
len += len2;

len2 = snprintf(buffer + len, buflen - len, "%d. Place - %s - %d points.",
pos,
row[0],
points);
++pos;
if (len2 < 0 || len2 >= (int) buflen - len)
len += (buflen - len) - 1;
else
len += len2;
}
}

void CHARACTER::GetRundRank(char * buffer, size_t buflen)
{
std::auto_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery("SELECT name, points FROM log.okay_event ORDER BY points DESC LIMIT 10"));
if (pMsg->Get()->uiNumRows == 0)
{
return;
}

MYSQL_ROW row;
int pos = 1;
int len = 0, len2;
*buffer = '\0';
while (NULL != (row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
{
int points = 0;
str_to_number(points, row[1]);
len2 = snprintf(buffer + len, buflen - len, "[ENTER]");

if (len2 < 0 || len2 >= (int) buflen - len)
len += (buflen - len) - 1;
else
len += len2;

len2 = snprintf(buffer + len, buflen - len, "%d. Place - %s - %d points.",
pos,
row[0],
points);
++pos;
if (len2 < 0 || len2 >= (int) buflen - len)
len += (buflen - len) - 1;
else
len += len2;
}
}

ez alapján rakom be http://www.freakgamers.org/threads/mega-release-c-lua-py-new-gameforge-event-okay-cards.4132/

vagyis cpp létre van hozva a kártyának ami le írásba is van

És makefile-be bele is van írva?

2017-02-16, 19:58:01 #11 Utolsó szerkesztés: 2017-02-16, 20:00:41 Szerző: Levi999
le írást követem ott nem ír ilyen make-t amit te írsz most 

de ha le íród hogy hol adjam hozzá akkor hozzá adom mert eszt nem tudtam hogy még hozzá kel hogy adjam vagy hasonló.

elméletbe hozzá adtam most de hogy jó lesz pasz :)

Ha, új cpp-t raksz be alap, hogy hozzá kell adni másképpen nem fogja neked beolvasni ha, csak be rakod.

köszi jelzek majd ha megint fail lesz vagy hasonló