Archive

Archive for the ‘教學文章’ Category

Flock安裝新版Flash Player

March 15th, 2009

最近在使用Flock的時候,每次遇到flash的網頁時,就會出現Flash的偵錯訊息

實在是覺得很煩,可是直接安裝Adobe Flash Player又無法解決這個問題!

所以只好改手動安裝Adobe Flash Player 10囉!

首先下載新版的Flash Player http://www.adobe.com/tw/products/flashplayer/

記得選支援Firefox, Safari, Opera的這個版本,基本上Flock=Firefox !

下載回來之後將執行檔解壓縮,需要用7-zip才行!

解壓縮完之後將NPSWF32.dll這個檔案放到Flock\plugins底下即可! (要覆蓋時記得關閉瀏覽器)

這樣就可以讓flock使用最新版本的Flash囉! :)

Squall 教學文章 ,

[T007] 修正變換髮型造成當機的錯誤

April 22nd, 2008

針對[T007] 讓倉庫管理員變成造型師 這篇作修正的!

原本的code裡面不小心寫到不存在的”髮型”,所以當你選到那個地方的時候,就會造成錯誤囉!
只要把下面紅色的地方修正即可!


// add by squall 2008-08-04-14
void NPCsScripts::npc_1002005(NPC* npc){
int state = npc->getState();
int skins[] = {0, 1, 2, 3, 4};
int hairs[] = {31000, 31010, 31020, 31030, 31040, 31050, 31060, 31070, 31080, 31090, 31100, 31110, 31120, 31130, 31140, 31150, 31160, 31170, 31180, 31190, 31200, 31210, 31220, 31230, 31240, 31250, 31260, 31270, 31280, 31290, 31300, 31310, 31320, 31330, 31340, 31350, 31400, 31410, 31420, 31430, 31440, 31450, 31460, 31470, 31480, 31490, 31510, 31520, 31530, 31540, 31550, 31560, 31570, 31580, 31590, 31600, 31610, 31620, 31630, 31640, 31650, 31680, 31690, 31700, 31710, 31720, 31730};
int hairscolor[] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8};

int eyes[] = {21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21009, 21010, 21011, 21012, 21013, 21014, 21016, 21017, 21018, 21019, 21020, 21022};
if(state == 0){
npc->addText("#L0#變換膚色#l\r\n#L1#變換髮型#l\r\n#L2#變換髮型顏色#l\r\n#L3#變換眼睛#l\r\n#L4#變換眼睛顏色#l");
npc->sendSimple();
}
else if(state == 1){
int type = npc->getSelected();
npc->setVariable("type", type);
if(type == 0){
npc->sendStyle(skins, 5);
}
else if(type == 1){
npc->sendStyle(hairs, 67);
}
else if(type == 2){
int cur = npc->getPlayerHair()/10*10;
int colors[] = {cur, cur+1, cur+2, cur+3, cur+4, cur+5, cur+6, cur+7};
npc->sendStyle(colors, hairscolor[npc->getPlayerHair()%1000/10]);
}
else if(type == 3){
npc->sendStyle(eyes, 21);
}
else if(type == 4){
int cur = npc->getPlayerEyes()%100+20000;
int colors[] = {cur, cur+100, cur+200, cur+300, cur+400, cur+500, cur+600, cur+700};
npc->sendStyle(colors, 8);
}
else{
npc->end();
}
}
else if(state == 2){
npc->end();
int type = npc->getVariable("type");
if(type == 0){
npc->setStyle(skins[npc->getSelected()]);
}
else if(type == 1){
npc->setStyle(hairs[npc->getSelected()]);
}
else if(type == 2){
npc->setStyle(npc->getPlayerHair()/10*10 + npc->getSelected());
}
else if(type == 3){
npc->setStyle(eyes[npc->getSelected()]);
}
else if(type == 4){
npc->setStyle(20000+npc->getPlayerEyes()%100 + npc->getSelected()*100);
}
else
npc->setStyle(eyes[npc->getSelected()]);
}

}

Squall 教學文章

[T007] 讓倉庫管理員變成造型師

April 17th, 2008

每次變換髮型,眼睛都要到各地的城市去,還要買卷..實在是太麻煩啦!!

所以我把倉庫管理員變成造型師囉! 哈哈

首先確定版本是否吻合喔! 需要修改三個地方 :)

NPCsScript.h
需要新增下列這兩行程式碼,至於加在哪呢? 看起來跟他一樣的地方就是啦!
隨便找地方插進去!:P

case 1002005: npc_1002005(npc); break;
static void npc_1002005(NPC* npc);

switch(npcid){

// add by squall (change eyes/hair)
case 1002005: npc_1002005(npc); break; // 把我這行加進去喔~~~

case 2100: npc_2100(npc); break;
case 2101: npc_2101(npc); break;
case 2020005: npc_2020005(npc); break;
另外一段在下面~]private:
static void npc_1002005(NPC* npc); // 把我這行加進去喔~~~
static void npc_2100(NPC* npc);
static void npc_2101(NPC* npc);
把下面程式碼整段貼到PlasticSurgery.cpp// add by squall 2008-08-04-14
void NPCsScripts::npc_1002005(NPC* npc){
int state = npc->getState();
int skins[] = {0, 1, 2, 3, 4};
int hairs[] = {31000, 31010, 31020, 31030, 31040, 31050, 31060, 31070, 31080, 31090, 31100, 31110, 31120, 31130, 31140, 31150, 31160, 31170, 31180, 31190, 31200, 31210, 31220, 31230, 31240, 31250, 31260, 31270, 31280, 31290, 31300, 31310, 31320, 31330, 31340, 31350, 31360, 31370, 31380, 31390, 31400, 31410, 31420, 31430, 31440, 31450, 31460, 31470, 31480, 31490, 31500, 31510, 31520, 31530, 31540, 31550, 31560, 31570, 31580, 31590, 31600, 31610, 31620, 31630, 31640, 31650, 31660, 31670, 31680, 31690, 31700, 31710, 31720, 31730};
int hairscolor[] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8};
int eyes[] = {21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21009, 21010, 21011, 21012, 21013, 21014, 21016, 21017, 21018, 21019, 21020, 21022};
if(state == 0){
npc->addText("#L0#變換膚色#l\r\n#L1#變換髮型#l\r\n#L2#變換髮型顏色#l\r\n#L3#變換眼睛#l\r\n#L4#變換眼睛顏色#l");
npc->sendSimple();
}
else if(state == 1){
int type = npc->getSelected();
npc->setVariable("type", type);
if(type == 0){
npc->sendStyle(skins, 5);
}
else if(type == 1){
npc->sendStyle(hairs, 74);
}
else if(type == 2){
int cur = npc->getPlayerHair()/10*10;
int colors[] = {cur, cur+1, cur+2, cur+3, cur+4, cur+5, cur+6, cur+7};
npc->sendStyle(colors, hairscolor[npc->getPlayerHair()%1000/10]);
}
else if(type == 3){
npc->sendStyle(eyes, 21);
}
else if(type == 4){
int cur = npc->getPlayerEyes()%100+20000;
int colors[] = {cur, cur+100, cur+200, cur+300, cur+400, cur+500, cur+600, cur+700};
npc->sendStyle(colors, 8);
}
else{
npc->end();
}
}
else if(state == 2){
npc->end();
int type = npc->getVariable("type");
if(type == 0){
npc->setStyle(skins[npc->getSelected()]);
}
else if(type == 1){
npc->setStyle(hairs[npc->getSelected()]);
}
else if(type == 2){
npc->setStyle(npc->getPlayerHair()/10*10 + npc->getSelected());
}
else if(type == 3){
npc->setStyle(eyes[npc->getSelected()]);
}
else if(type == 4){
npc->setStyle(20000+npc->getPlayerEyes()%100 + npc->getSelected()*100);
}
else
npc->setStyle(eyes[npc->getSelected()]);
}

}
更新版:

// add by squall 2008-08-04-14
void NPCsScripts::npc_1002005(NPC* npc){
int state = npc->getState();
int skins[] = {0, 1, 2, 3, 4};
int hairs[] = {31000, 31010, 31020, 31030, 31040, 31050, 31060, 31070, 31080, 31090, 31100, 31110, 31120, 31130, 31140, 31150, 31160, 31170, 31180, 31190, 31200, 31210, 31220, 31230, 31240, 31250, 31260, 31270, 31280, 31290, 31300, 31310, 31320, 31330, 31340, 31350, 31400, 31410, 31420, 31430, 31440, 31450, 31460, 31470, 31480, 31490, 31510, 31520, 31530, 31540, 31550, 31560, 31570, 31580, 31590, 31600, 31610, 31620, 31630, 31640, 31650, 31680, 31690, 31700, 31710, 31720, 31730};
int hairscolor[] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8};
int eyes[] = {21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21009, 21010, 21011, 21012, 21013, 21014, 21016, 21017, 21018, 21019, 21020, 21022};
if(state == 0){
npc->addText("#L0#變換膚色#l\r\n#L1#變換髮型#l\r\n#L2#變換髮型顏色#l\r\n#L3#變換眼睛#l\r\n#L4#變換眼睛顏色#l");
npc->sendSimple();
}
else if(state == 1){
int type = npc->getSelected();
npc->setVariable("type", type);
if(type == 0){
npc->sendStyle(skins, 5);
}
else if(type == 1){
npc->sendStyle(hairs, 67);
}
else if(type == 2){
int cur = npc->getPlayerHair()/10*10;
int colors[] = {cur, cur+1, cur+2, cur+3, cur+4, cur+5, cur+6, cur+7};
npc->sendStyle(colors, hairscolor[npc->getPlayerHair()%1000/10]);
}
else if(type == 3){
npc->sendStyle(eyes, 21);
}
else if(type == 4){
int cur = npc->getPlayerEyes()%100+20000;
int colors[] = {cur, cur+100, cur+200, cur+300, cur+400, cur+500, cur+600, cur+700};
npc->sendStyle(colors, 8);
}
else{
npc->end();
}
}
else if(state == 2){
npc->end();
int type = npc->getVariable("type");
if(type == 0){
npc->setStyle(skins[npc->getSelected()]);
}
else if(type == 1){
npc->setStyle(hairs[npc->getSelected()]);
}
else if(type == 2){
npc->setStyle(npc->getPlayerHair()/10*10 + npc->getSelected());
}
else if(type == 3){
npc->setStyle(eyes[npc->getSelected()]);
}
else if(type == 4){
npc->setStyle(20000+npc->getPlayerEyes()%100 + npc->getSelected()*100);
}
else
npc->setStyle(eyes[npc->getSelected()]);
}

}

這樣就完成啦,以後只要找到倉庫管理員,就可以變換造型囉!

Squall 教學文章

[T007] 解決四轉技能無法重登的問題 (治標不治本)

April 15th, 2008

相信大家都想要擁有四轉技能…不過偏偏伺服器不夠完整!

每次玩完就要刪除..實在是很麻煩!!

所以啦~在還沒真正解決四轉技能為何會造成無法登入之前..先簡單寫個鳥程式來解決吧!XD

首先開啟MySQLM.cpp,找個你喜歡的地方將下面的程式碼貼上
//add by squall
void MySQL::delete4thSkills(int id){
char query[500];
sprintf_s(query, 500, "DELETE FROM skills WHERE charid='%d' AND (skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s');", id, "112%","122%","132%","212%","222%","232%","312%","412%","422%");
mysql_real_query(&maple_db, query, strlen(query));
}

在MySQLM.h加入
static void delete4thSkills(int id);

最後在Player.cpp中加入
//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid());

這邊有一個地方要注意的,必須放在取得技能之前,所以建議放在[color=Red]int skill[200][2];[/color]的下面一行…
看起來如下
int skill[200][2];
//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid()); // 這段是新加進去的唷!!
many = MySQL::getSkills(getPlayerid(), skill);
好啦~這樣每次玩遊戲都可以放心的玩四轉技能囉! 不過還是希望盡快找出四轉技能會當機的問題…囧!

==================補充說明==================

看樣子大家似乎都有遇到類似的問題

是Player.CPP不是Players.CPP

所以可能要請大家找 many = MySQL::getSkills(getPlayerid(), skill); 或是 getSkills

只要把MySQL::delete4thSkills(getPlayerid()); 這段放在取得技能之前即可

類似這樣…大家在努力試試看吧! :) for(int i=0; i Item* item = new Item;
item->id = items[i][0];
item->inv = items[i][1];
item->pos = items[i][2];
item->amount = items[i][3];
inv->addItem(item);
}
int skill[200][2];

//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid());

many = MySQL::getSkills(getPlayerid(), skill);

for(int i=0; i skills->addSkillLevel(skill[i][0], skill[i][1]);
//SkillsPacket::addSkill(this, skill[i][0] , skills->getSkillLevel(skill[i][0]));
}

Squall 教學文章