?? skill.cpp
字號:
#include "stdafx.h"
#include <Ddraw.h>
#include <Math.h>
#include "sys/stat.h"
#include "Dragon.h"
#include "Hong_Sprite.h"
#include "Hong_Sub.h"
#include "char.h"
#include "map.h"
#include "Path.h"
#include "MouseCursor.h"
#include "DirectSound.h"
#include "CharDataTable.h"
#include "Effect.h"
//#include "MenuDef.h"
#include "ItemTable.h"
#include "NetWork.h"
#include "GameProc.h"
#include "Hangul.h"
#include "Tool.h"
#include "Item.h"
#include "SkillTool.h"
#include "Menu.h"
#include "TextOutMgr.h"
#include "smallMenu.h"
#include "Skill.h"
#include "language.h"
#include "NumberAniMgr.h"
#include "SymbolMgr_Client.h"//soto-1.02
extern CSymbolMgr_Client g_SymBolMgr;//soto-1.02
SkillMain SkillTable[ MAX_SKILL_];
char SkillOutputMessage[ 31];
LPSKILLGAUGE g_SkillGauge;
ITEMMULTIRARE aIMR[MAX_ITEM_MULTI_RARE];//021111 lsw
extern void SetBattlePeace( const int type );
/*
鍋齲流訣
1 Farmer
2 Miner
3 Fisher
4 Lumberjack
5 Butcher
6 Herb-digger
7 Herdsman
8 Carpenter
9 Blacksmith
10 Cooker
11 Tailor
12 Bowcraft/Fletcher
13 Alchemist
14 Candlemaker
15 Merchant
*/
/* // Skill No.....
1 Detect Ghost
2 Talk With
3 Poisoning
4 Detect Poison
5 Find Traps
6 Remove Traps
7 Entrapmen -------------------
8 Magic Scrolling
9 Ability Scrolling
10 Emergency Alram
11 First Aid
12 Fast Foot
13 Secrethear
14 Wallclimbing
15 Intuition
16 Detect Bomb
17 Bomb in --------------------
18 Remove Bomb
19 Stealing
20 Lockpicking
21 Reclaim
22 Sow
23 Cultivate
24 Havest
25 Detect Mineral
26 Mining
27 Refine
28 Fish
29 Baitmaking
30 Netting
31 Sailing
32 Cutting
33 Lumbering
34 Butchering
35 Detect Herb
36 Digging
37 Makepowder
38 Herding
39 Milking
40 Midwifery
41 Shear
42 Manufacturing
43 Manufacturing
44 Cooking
45 Clothing
46 Dyeing
47 Tailoring
48 Bowcrafting
49 Fletching
50 MakePotion
51 MakeMetal
52 MakeBottle
53 Candlemaking
54 Oiling
55 Repairng
56 Reutilizing
57 Playing
58 Peacemaking
59 Paralysis
60 Hallucination
61 Provocation
62 Enticement
63 Noise
64 Tracking
65 Snooping
66 Search
67 Silentmove
68 Disguise
69 Chameleon
70 Hide on
71 Object Hidding
72 Hide
73 Camping
74 Makefire
75 Taming
76 Communicate with
77 Communicate with
78 Animal lore
79 Arms lore
80 Evaluate Inteligence
81 Evaluate Wisdom
82 Anatomy Judgement
83 Item Identification
84 Taste Identification
85 Appraisal
86 Healing
87 Tactics
88 Crapple
89 Swordmanship
90 Archery
91 Fencing
92 Mace Fighting
93 Pierce
94 Whirl
95 Hurl
96 Parrying
97 Double Swordmanship
98 Double Macefighting
99 Magery
100 Orison
*/
/*
1
2
3
4
8
9
10
11
12
13
14
15
case 5 :
case 6 :
case 7 :
case 16:
case 17:
case 18:
case 19:
20
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
29
30
31
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
38
39
40
case 41:
42
43
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
50
case 51:
case 52:
case 53:
case 54:
55
56
57
58
59
60
61
62
63
64
case 65:
66
67
68
69
70
71
72
73
case 74:
case 75:
76
77
78
79
case 80:
case 81:
case 82:
83
84
85
86
87
101
102
103
104
105
c[cn].chrlst.Skill[i] = 1;
*/
////////////////////////////////////////////////////////////////////////////////////
///
/// External variables...
///
extern Spr skill_spr[102];
extern void SetItemPos(int type, POS*);
extern void SetItemPos(int type, int p, POS*);
extern void SetItemPos(int type, int p1, int p2, int p3, POS*);
extern ItemAttr *GetItemByPos( POS item );
extern struct InterfaceFlag main_interface;
extern int SkillOn;
extern int nItemOther;
extern ItemAttr InvItemAttr[3][3][8];
extern ItemAttr EquipItemAttr[8];
extern ItemAttr QuickItemAttr[7];
extern PosItem skill_use_item[5][10];
extern PosItem skill_use_item_result;
/////////////////////////////////////////////////////////////////////////////////////
///
/// User variables...
///
int SkillNo;
int SkillStatus;
Spr *SkillIcon;
int SkillItemNo; // 扁賤俊 葷儈瞪 Item狼 鍋齲.
POS SkillItemPOS; // 扁賤俊 葷儈瞪 Item狼 困摹藹.
//1005 zhh
LPITEMGROUND Skill_CursorCheckedItem;//膠懦撈 酒撈袍闌 鞘夸肺 且 版快
/////////////////////////////////////////////////////////////////////////////////////
///
/// User Functions Declaration...
///
void GameStatusOutput( int no );
void AgainSkill( int skillno );
void DrawSkilltile( int skillno, int x, int y );
void DrawSkillGauge( LPSKILLGAUGE n );
void DeleteSkillGauge( LPSKILLGAUGE tt );
LPSKILLGAUGE AddSkillGauge( int skillno, int x, int y, int min );
void OutputSkillGauge( void );
void SendSkillGauge( int x, int y, int skillno );
void RecvSkillGauge( t_server_skill_gauge *p );
//1004 zhh
int AmIEquitSkillTool(int Skillno);
//010205 lsw
int skill_fail(int skill);//1瞞 流訣 郴儈 角菩矯 唱坷綽 皋技瘤
/////////////////////////////////////////////////////////////////////////////////////
///
/// User Functions...
///
void LoadHongSkillTable( void )
{
//1024 zhh Dragon.cpp俊 絆摹瘤 臼扁 困秦輯 咯扁促啊 眠啊
//010215 lsw 酒貳 滴臨 林籍 貿府 沁瀾.
// if(!LoadLanguageText())
// MessageBox(NULL,"Loading Language Pack Error","LanguagePack",NULL);
FILE *fp;
int i;
char crc, crc1 = 0;
fp = Fopen( "./data/skilltable.bin", "rb" );
if( fp == NULL ) return;
fread( &crc, 1,1, fp );
fread( SkillTable, sizeof( SkillMain ), MAX_SKILL_, fp);
fclose(fp);
char *tt = (char *)SkillTable;
for( i = 0 ; i < sizeof( SkillMain ) * MAX_SKILL_ ; i ++)
{
crc1 += (( *tt + *tt ) - i );
*tt -= ( 200 + i );
tt ++;
}
for( i = 0 ; i < MAX_SKILL ; i ++)
{
EatRearWhiteChar( SkillTable[i].Skill_Minute);
}
//< CSD-030324
/*
if( GetSysInfo( SI_GAME_MAKE_MODE ) )
{
fp = Fopen( "./data/凱絹扼(SkillTable_effect_wave).txt", "wb" );
if( fp )
{
for( int i = 0 ; i < 102 ; i ++)
{
fprintf( fp, "%d : %d \n", i, SkillTable[ i].effect_wave );
}
fclose(fp);
}
}
*/
//> CSD-030324
if( CheckSumError == 0 )
{
CheckSumError = abs( crc - crc1 );
if( CheckSumError ) JustMsg( "skilltable.bin CheckSumError " );
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// 扁 瓷 : 扁賤備泅闌 困秦 悸潑茄 巴闌 瘤款促.( 扁賤闌 讒辰促.)
// 牢 磊 : (1). 扁賤 矯傈 饒 惑怕肺 埃促.
// (2). 扁賤 矯傈 傈 惑怕肺 埃促( 扁賤角青撈 場車促. )
// 搬 苞 : 絕嬌.
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void SkillSettingClear( void )
{
SkillStatus = SKILL_OFF;
CursorNo( 1 );
MouseCursorOnOff = true;
SkillOn = -1;
}
void SendSkillMatter( MakeItem *matter )
{
// ItemAttr *t;
t_packet p;
int i;
p.h.header.type = CMD_SKILL_ITEM_MATTER;
{
for( i = 0 ; i < 20 ; i ++)
p.u.client_skill_item_matter.pos[i] = matter[i].pos;
}
p.h.header.size = sizeof( t_client_skill_item_matter );
QueuePacket( &p, 1 );
SkillStatus = SKILL_ING;
for( i = 0 ; i < 20 ; i ++)
{
ItemAttr *t = ::GetItemByPos( matter[i].pos );
DeleteItem( t );
}
CursorNo( 1 );
}
extern void CheckTreasure( int x, int y ); // 040105 YGI
// 040105 YGI
void SendSkillInfo( int skillno, int x, int y, int targettype, int targetid ,const int iKey, const char* TargetName)//030102 lsw
{
POS s;
s.type = 0;
memset(&s,0,sizeof(POS));
SendSkillInfo( skillno, x, y, targettype, targetid, s, iKey,TargetName);//020531 lsw
if( skillno == SKILL_MINING )
{
CheckTreasure( x, y);
}
}
extern int g_EventLocalWarBegin;
void SendSkillInfo( int skillno, int x, int y, int targettype, int targetid, POS s,const int iKey, const char* TargetName)//030102 lsw
{
if ((MapNumber==39)&&(g_EventLocalWarBegin==3)) return; // LTS BUG
switch( skillno )
{
// view ghost...
case 1 :
case 2 :
{
if( CanViewGhost(Hero) ) // 扁賤闌 吝汗竅咯 葷儈且薦 絕促.
{
strcpy( Hero->szChatMessage, lan->OutputMessage(2,189));
Hero->ChatDelay = 70;
SkillSettingClear();
return;
}
}
break;
case 5 :
case 16 : InsertMagic( Hero, Hero, 212, 0, Mox, Moy - 80, 0,0 );
break;
case 34 :
break;
}
//010204 lsw
//1024 zhh
if(skillno >100)
{
AddCurrentStatusMessage( 150,150,255,lan->OutputMessage(2,31), SkillTable[skillno].Skill_Minute );
}
t_packet p;
p.h.header.type = CMD_SKILL_INFO;
{
p.u.client_skill_info.skillno = SkillNo;
p.u.client_skill_info.x = x;
p.u.client_skill_info.y = y;
p.u.client_skill_info.targettype= targettype;
p.u.client_skill_info.target_id = targetid;
p.u.client_skill_info.s = s;
p.u.client_skill_info.iKey = iKey;
if(TargetName == NULL)
{
::strcpy(p.u.client_skill_info.TargetName,"");//030102 lsw
}
else
{
::strcpy(p.u.client_skill_info.TargetName,TargetName);
}
}
p.h.header.size = sizeof( t_client_skill_info );
QueuePacket( &p, 1 );
SkillStatus = SKILL_ING;
// CursorNo( 1 );
}
/* 己傍 250, 1,
// 2,
// 3,
// 4,
// 5- 角菩...
// 6- 角菩...
己傍 Wave鍋齲 : 108
角菩 Wave鍋齲 : 109
case 0: //Skill->Level Up
InsertMagic( scr, scr, 211, -1, 0, 0, x, y); //Level Up
break;
case 1: //Skill->Detect
InsertMagic( scr, scr, 212, 0, Mox, Moy, 0, 0); //Skill_Detect
break;
case 2: //Skill->Identify
InsertMagic( scr, scr, 213, 0, Mox, Moy, 0, 0 ); //Skill_Identify
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -