battle interaction: attack from sample perl client, and get notice “npc was killed” message. (Rev.99)

ok, now, simpledungeon server supports basic battle functionality.
Player character can “attack” to npc,
and npc get some damage by this attack,
and when npc’s hit point got zero or negative, every neighbor character get “killed” message.

following test log indicates this functionality.

I’ll update silverlight client to visualize battle functionality.

C:\Users\b-itoh\Documents\src\erlang\mmoasp\trunk\sampleclient\perl>perl test.pl

prompt:login id0001 pw0001
login
id0001 pw0001
content:{“result”:”ok”,”cid”:”cid0001″,”token”:”8372000364000d6e6f6e6f6465406e6f
686f7374000000033e0000000000000000″}
Dumper:$VAR1 = {
‘cid’ => ‘cid0001′,
‘token’ => ‘8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000000
00000000′,
‘result’ => ‘ok’
};

cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:

content:[{“id”:”8372000364000d6e6f6e6f6465406e6f686f7374000000034c00000000000000
00″,”type”:”login”,”cid”:”cid0001″,”name”:”alpha”},{“cid”:”cid0001″,”name”:”alph
a”,”type”:”pc”,”align”:”good”,”hp”:12,”x”:1,”y”:1,”z”:0,”map”:1},{“cid”:”npc0001
“,”name”:”Slime”,”type”:”npc”,”hp”:2,”x”:2,”y”:1,”z”:null,”map”:1}]
Dumper:$VAR1 = [
{
‘name’ => ‘alpha’,
‘cid’ => ‘cid0001′,
‘type’ => ‘login’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f7374000000034c000000000
0000000′
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 2,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];

$VAR1 = [
{
‘name’ => ‘alpha’,
‘cid’ => ‘cid0001′,
‘type’ => ‘login’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f7374000000034c000000000
0000000′
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 2,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];
cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:attack npc0001
attack
npc0001
content:{“result”:”ok”}
Dumper:$VAR1 = {
‘result’ => ‘ok’
};

cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:

content:[{“id”:”8372000364000d6e6f6e6f6465406e6f686f7374000000037900000000000000
00″,”type”:”attack”,”from_cid”:”cid0001″,”to_cid”:”npc0001″,”result”:”ok”,”damag
e”:1},{“cid”:”cid0001″,”name”:”alpha”,”type”:”pc”,”align”:”good”,”hp”:12,”x”:1,”
y”:1,”z”:0,”map”:1},{“cid”:”npc0001″,”name”:”Slime”,”type”:”npc”,”hp”:1,”x”:2,”y
“:1,”z”:null,”map”:1}]
Dumper:$VAR1 = [
{
‘damage’ => 1,
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘type’ => ‘attack’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f73740000000379000000000
0000000′,
‘result’ => ‘ok’
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 1,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];

$VAR1 = [
{
‘damage’ => 1,
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘type’ => ‘attack’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f73740000000379000000000
0000000′,
‘result’ => ‘ok’
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 1,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];
cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:attack npc0001
attack
npc0001
content:{“result”:”ok”}
Dumper:$VAR1 = {
‘result’ => ‘ok’
};

cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:

content:[{“id”:”8372000364000d6e6f6e6f6465406e6f686f737400000003a800000000000000
00″,”type”:”attack”,”from_cid”:”cid0001″,”to_cid”:”npc0001″,”result”:”ok”,”damag
e”:1},{“id”:”8372000364000d6e6f6e6f6465406e6f686f737400000003ad0000000000000000″
,”type”:”killed”,”cid”:”npc0001″,”from_cid”:”cid0001″,”to_cid”:”npc0001″},{“cid”
:”cid0001″,”name”:”alpha”,”type”:”pc”,”align”:”good”,”hp”:12,”x”:1,”y”:1,”z”:0,”
map”:1},{“cid”:”npc0001″,”name”:”Slime”,”type”:”npc”,”hp”:0,”x”:2,”y”:1,”z”:null
,”map”:1}]
Dumper:$VAR1 = [
{
‘damage’ => 1,
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘type’ => ‘attack’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f737400000003a8000000000
0000000′,
‘result’ => ‘ok’
},
{
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘cid’ => ‘npc0001′,
‘type’ => ‘killed’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f737400000003ad000000000
0000000′
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 0,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];

$VAR1 = [
{
‘damage’ => 1,
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘type’ => ‘attack’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f737400000003a8000000000
0000000′,
‘result’ => ‘ok’
},
{
‘to_cid’ => ‘npc0001′,
‘from_cid’ => ‘cid0001′,
‘cid’ => ‘npc0001′,
‘type’ => ‘killed’,
‘id’ => ‘8372000364000d6e6f6e6f6465406e6f686f737400000003ad000000000
0000000′
},
{
‘hp’ => 12,
‘align’ => ‘good’,
‘name’ => ‘alpha’,
‘x’ => 1,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘cid0001′,
‘type’ => ‘pc’,
‘z’ => 0
},
{
‘hp’ => 0,
‘name’ => ‘Slime’,
‘x’ => 2,
‘y’ => 1,
‘map’ => 1,
‘cid’ => ‘npc0001′,
‘type’ => ‘npc’,
‘z’ => undef
}
];
cid is cid0001, token is 8372000364000d6e6f6e6f6465406e6f686f7374000000033e00000
00000000000
prompt:logout
logout

content:{“result”:”ok”}
Dumper:$VAR1 = {
‘result’ => ‘ok’
};

cid is , token is
prompt:

1 comment to battle interaction: attack from sample perl client, and get notice “npc was killed” message. (Rev.99)

  • Rae

    Your website’s design looks not proffesional. You schould change it.
    Better graphics means a lot more conversions, faster load and greater confidence of visitors.
    This is something that can be useful for you, type in google:
    Juicklor’s templates source

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>