summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-08-18 15:21:07 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-08-18 15:21:07 +0000
commit7982a54c295a8aaf5b4c855a4face377ba189d39 (patch)
treec51ebb2c5dd8005bca84897f469922c38dc9c374 /src
parent141975cfd22b21403383ea5213cb85ef5427fc9e (diff)
downloadmana-7982a54c295a8aaf5b4c855a4face377ba189d39.tar.gz
mana-7982a54c295a8aaf5b4c855a4face377ba189d39.tar.bz2
mana-7982a54c295a8aaf5b4c855a4face377ba189d39.tar.xz
mana-7982a54c295a8aaf5b4c855a4face377ba189d39.zip
Updated reference to latest libxml, fixed a bug in updating skills, updated skill names database.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp31
-rw-r--r--src/gui/skill.cpp22
-rw-r--r--src/gui/skill.h1
3 files changed, 23 insertions, 31 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 4b3d78a1..c130870f 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -843,29 +843,10 @@ void do_parse()
if (in_size >= 2) {
// Check if the received packet is complete
while (in_size >= (len = get_packet_length(id = RFIFOW(0)))) {
- // Add infos to log file and dump the latest received packet
- char pkt_nfo[60];
- sprintf(pkt_nfo,"In-buffer size: %i Packet id: %x Packet length: %i", in_size, RFIFOW(0), len);
- /*
- log_hex("Packet", "Packet_ID", RFIFOW(0));
- log_int("Packet", "Packet_length", get_length(RFIFOW(0)));
- log_int("Packet", "Packet_in_size", RFIFOW(2));
- log_int("Packet", "In_size", in_size);
- FILE *file = fopen("packet.dump", "wb");
- for(int i=0;i<len;i++) {
- fprintf(file, "%x|%i|%c ", RFIFOB(i), RFIFOB(i), RFIFOB(i));
- if((i+1)%10==0)fprintf(file, "\n");
- }
- fclose(file);
- */
-#ifdef __DEBUG
- FILE *file = fopen("packet.list", "a");
- fprintf(file, "%x\n", RFIFOW(0));
- fclose(file);
-#endif
+ printf("Packet_ID: %x\n", RFIFOW(0));
+
// Parse packet based on their id
- // std::cout << "packet " << id << std::endl;
- switch (id)
+ switch (id)
{
case SMSG_LOGIN_SUCCESS:
// Connected to game server succesfully, set spawn point
@@ -1054,7 +1035,7 @@ void do_parse()
case SMSG_MOVE_PLAYER_BEING:
// A nearby player being moves
- being = findNode(RFIFOL(2));
+ /*being = findNode(RFIFOL(2));
if (being == NULL)
{
@@ -1072,7 +1053,7 @@ void do_parse()
being->setDestination(
get_dest_x(RFIFOP(50)),
- get_dest_y(RFIFOP(50)));
+ get_dest_y(RFIFOP(50)));*/
break;
// NPC dialog
@@ -1556,7 +1537,7 @@ void do_parse()
if (skillDialog->hasSkill(skillId)) {
skillDialog->setSkill(skillId,
RFIFOW(4 + k * 37 + 6),
- RFIFOW(4 + k * 37 + 36));
+ RFIFOB(4 + k * 37 + 36));
}
else {
skillDialog->addSkill(
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index ebacf761..064354cd 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -35,7 +35,7 @@
char *skill_db[] = {
// 0-99
- "", "Basic", "Sword", "", "HP regeneration", "", "", "", "", "MP regeneration",
+ "", "Basic", "Sword", "Two hand", "HP regeneration", "Bash", "Provoke", "Magnum", "Endure", "MP regeneration",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "MAX weight", "Discount", "Overcharge", "",
@@ -50,7 +50,7 @@ char *skill_db[] = {
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
- "", "", "First aid", "Play as dead", "", "", "", "", "", "",
+ "", "", "First aid", "Play as dead", "Moving recovery", "Fatal blow", "Auto berserk", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
@@ -66,26 +66,35 @@ SkillDialog::SkillDialog():
skillListBox = new ListBox(this);
skillScrollArea = new ScrollArea(skillListBox);
pointsLabel = new gcn::Label("Skill Points:");
- incButton = new Button(" Up ");
+ incButton = new Button("Up");
+ useButton = new Button("Use");
closeButton = new Button("Close");
skillListBox->setEventId("skill");
incButton->setEventId("inc");
+ useButton->setEventId("use");
closeButton->setEventId("close");
setContentSize(240, 240);
- skillScrollArea->setDimension(gcn::Rectangle(5, 5, 229, 180));
+ skillScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
+ skillScrollArea->setDimension(gcn::Rectangle(5, 5, 230, 180));
pointsLabel->setDimension(gcn::Rectangle(8, 190, 200, 16));
- incButton->setPosition(64, 210);
- closeButton->setPosition(160, 210);
+ incButton->setPosition(skillScrollArea->getX(), 210);
+ useButton->setPosition(incButton->getX() + incButton->getWidth() + 10,
+ 210);
+ closeButton->setPosition(
+ skillScrollArea->getX() + skillScrollArea->getWidth() - closeButton->getWidth(),
+ 210);
add(skillScrollArea);
add(pointsLabel);
add(incButton);
+ add(useButton);
add(closeButton);
skillListBox->addActionListener(this);
incButton->addActionListener(this);
+ useButton->addActionListener(this);
closeButton->addActionListener(this);
setLocationRelativeTo(getParent());
@@ -176,6 +185,7 @@ bool SkillDialog::hasSkill(int id)
void SkillDialog::addSkill(int id, int lv, int sp)
{
+ printf("%i\n", id);
SKILL *tmp = new SKILL();
tmp->id = id;
tmp->lv = lv;
diff --git a/src/gui/skill.h b/src/gui/skill.h
index e71af12a..a9111528 100644
--- a/src/gui/skill.h
+++ b/src/gui/skill.h
@@ -51,6 +51,7 @@ class SkillDialog : public Window, public gcn::ActionListener,
gcn::ScrollArea *skillScrollArea;
gcn::Label *pointsLabel;
gcn::Button *incButton;
+ gcn::Button *useButton;
gcn::Button *closeButton;
std::vector<SKILL*> skillList;