- Fixed npc_checknear's distance check returning the opposite of what it should (false when the range is correct and viceversa)
- SL_STIN/SL_STUN have dex-reducable casting times now. - Added a warning on item loading when an item is of equippable type but has no equippable position. - Turning an alliance to an opposition won't work now during WoE - Slaves can summon other mobs now. The only ones who can't do this are player summoned mobs. - Merged the following functions for faster processing of items: clif_storageitemlist + clif_storageequiplist = clif_storagelist clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist clif_itemlist + clif_equiplist = clif_inventorylist - Increased max knockback value support to 25. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7109 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
c422998669
commit
0158ab793e
@ -4,6 +4,19 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
|||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
2006/06/12
|
2006/06/12
|
||||||
|
* Fixed npc_checknear's distance check returning the opposite of what it
|
||||||
|
should (false when the range is correct and viceversa) [Skotlex]
|
||||||
|
* Added a warning on item loading when an item is of equippable type but
|
||||||
|
has no equippable position. [Skotlex]
|
||||||
|
* Turning an alliance to an opposition won't work now during WoE [Skotlex]
|
||||||
|
* Slaves can summon other mobs now. The only ones who can't do this are
|
||||||
|
player summoned mobs. [Skotlex]
|
||||||
|
* Merged the following functions for faster processing of items: [Skotlex]
|
||||||
|
clif_storageitemlist + clif_storageequiplist = clif_storagelist
|
||||||
|
clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist
|
||||||
|
clif_itemlist + clif_equiplist = clif_inventorylist
|
||||||
|
Note that the changes are a bit substantial and need proper testing!
|
||||||
|
* Increased max knockback value support to 25. [Skotlex]
|
||||||
* [Optimized]:
|
* [Optimized]:
|
||||||
- buildin_npcshopitem memory allocation to calculate before reallocating.
|
- buildin_npcshopitem memory allocation to calculate before reallocating.
|
||||||
[Lance]
|
[Lance]
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
=========================
|
=========================
|
||||||
06/12
|
06/12
|
||||||
|
* SL_STIN/SL_STUN have dex-reducable casting times now. [Skotlex]
|
||||||
* Temp sprite names for Rachel/Ice Dungeon monsters, thanks to Saycyber21. [Vicious]
|
* Temp sprite names for Rachel/Ice Dungeon monsters, thanks to Saycyber21. [Vicious]
|
||||||
- Chung E = temp sprites.
|
- Chung E = temp sprites.
|
||||||
* Fixed the mode of Monemus [MasterOfMuppets]
|
* Fixed the mode of Monemus [MasterOfMuppets]
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
410,1 //WE_CALLBABY
|
410,1 //WE_CALLBABY
|
||||||
482,1 //PF_DOUBLECASTING
|
482,1 //PF_DOUBLECASTING
|
||||||
462,1 //SL_KAIZEL
|
462,1 //SL_KAIZEL
|
||||||
467,1 //SL_STIN
|
|
||||||
468,1 //SL_STUN
|
|
||||||
1014,1 //PR_REDEMPTIO
|
1014,1 //PR_REDEMPTIO
|
||||||
10010,3 //GD_BATTLEORDER
|
10010,3 //GD_BATTLEORDER
|
||||||
10011,3 //GD_REGENERATION
|
10011,3 //GD_REGENERATION
|
||||||
|
@ -2200,9 +2200,7 @@ int atcommand_option(
|
|||||||
sd->sc.opt1 = param1;
|
sd->sc.opt1 = param1;
|
||||||
sd->sc.opt2 = param2;
|
sd->sc.opt2 = param2;
|
||||||
if (!(sd->sc.option & CART_MASK) && param3 & CART_MASK) {
|
if (!(sd->sc.option & CART_MASK) && param3 & CART_MASK) {
|
||||||
if (sd->status.class_ == JOB_BABY_MERCHANT)
|
clif_cartlist(sd);
|
||||||
clif_cart_itemlist(sd);
|
|
||||||
clif_cart_equiplist(sd);
|
|
||||||
clif_updatestatus(sd, SP_CARTINFO);
|
clif_updatestatus(sd, SP_CARTINFO);
|
||||||
}
|
}
|
||||||
pc_setoption(sd, param3);
|
pc_setoption(sd, param3);
|
||||||
|
606
src/map/clif.c
606
src/map/clif.c
@ -2134,341 +2134,263 @@ int clif_delitem(struct map_session_data *sd,int n,int amount)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
// Simplifies inventory/cart/storage packets by handling the packet section relevant to items. [Skotlex]
|
||||||
*
|
// Equip is > 0 for equippable items (holds the equip-point)
|
||||||
*------------------------------------------
|
// 0 for stackable items, -1 for stackable items where arrows must send in the equip-point.
|
||||||
*/
|
void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip)
|
||||||
int clif_itemlist(struct map_session_data *sd)
|
|
||||||
{
|
{
|
||||||
int i,n,fd,arrow=-1;
|
if (id->view_id > 0)
|
||||||
|
WBUFW(buf,n)=id->view_id;
|
||||||
|
else
|
||||||
|
WBUFW(buf,n)=i->nameid;
|
||||||
|
WBUFB(buf,n+2)=itemtype(id->type);
|
||||||
|
WBUFB(buf,n+3)=i->identify;
|
||||||
|
if (equip > 0) { //Equippable item.
|
||||||
|
WBUFW(buf,n+4)=equip;
|
||||||
|
WBUFW(buf,n+6)=i->equip;
|
||||||
|
WBUFB(buf,n+8)=i->attribute;
|
||||||
|
WBUFB(buf,n+9)=i->refine;
|
||||||
|
} else { //Stackable item.
|
||||||
|
WBUFW(buf,n+4)=i->amount;
|
||||||
|
if (equip == -1 && id->equip == 0x8000)
|
||||||
|
WBUFW(buf,n+6)=0x8000;
|
||||||
|
else
|
||||||
|
WBUFW(buf,n+6)=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Unified inventory function which sends all of the inventory (requires two packets, one for equipable items and one for stackable ones. [Skotlex]
|
||||||
|
void clif_inventorylist(struct map_session_data *sd)
|
||||||
|
{
|
||||||
|
int i,n,ne,fd = sd->fd,arrow=-1;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
|
unsigned char bufe[MAX_INVENTORY*20+4];
|
||||||
nullpo_retr(0, sd);
|
#if PACKETVER < 5
|
||||||
|
const int s = 10; //Entry size.
|
||||||
fd=sd->fd;
|
#else
|
||||||
WFIFOHEAD(fd, MAX_INVENTORY * 10 + 4);
|
const int s = 18;
|
||||||
|
#endif
|
||||||
|
WFIFOHEAD(fd, MAX_INVENTORY * s + 4);
|
||||||
buf = WFIFOP(fd,0);
|
buf = WFIFOP(fd,0);
|
||||||
|
|
||||||
|
for(i=0,n=0,ne=0;i<MAX_INVENTORY;i++){
|
||||||
|
if (sd->status.inventory[i].nameid <=0 || sd->inventory_data[i] == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(itemdb_isequip2(sd->inventory_data[i]))
|
||||||
|
{ //Equippable
|
||||||
|
WBUFW(bufe,ne*20+4)=i+2;
|
||||||
|
clif_item_sub(bufe, ne*20+6, &sd->status.inventory[i], sd->inventory_data[i], pc_equippoint(sd,i));
|
||||||
|
clif_addcards(WBUFP(bufe, ne*20+16), &sd->status.inventory[i]);
|
||||||
|
ne++;
|
||||||
|
} else { //Stackable.
|
||||||
|
WBUFW(buf,n*s+4)=i+2;
|
||||||
|
clif_item_sub(buf, n*s+6, &sd->status.inventory[i], sd->inventory_data[i], -1);
|
||||||
|
if (sd->inventory_data[i]->equip == 0x8000 &&
|
||||||
|
sd->status.inventory[i].equip)
|
||||||
|
arrow=i;
|
||||||
|
#if PACKETVER >= 5
|
||||||
|
clif_addcards(WBUFP(buf, n*s+14), &sd->status.inventory[i]);
|
||||||
|
#endif
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (n) {
|
||||||
#if PACKETVER < 5
|
#if PACKETVER < 5
|
||||||
WBUFW(buf,0)=0xa3;
|
WBUFW(buf,0)=0xa3;
|
||||||
for(i=0,n=0;i<MAX_INVENTORY;i++){
|
|
||||||
if (sd->status.inventory[i].nameid <=0 || sd->inventory_data[i] == NULL || itemdb_isequip2(sd->inventory_data[i]))
|
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*10+4)=i+2;
|
|
||||||
if (sd->inventory_data[i]->view_id > 0)
|
|
||||||
WBUFW(buf,n*10+6)=sd->inventory_data[i]->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*10+6)=sd->status.inventory[i].nameid;
|
|
||||||
WBUFB(buf,n*10+8)=itemtype(sd->inventory_data[i]->type);
|
|
||||||
WBUFB(buf,n*10+9)=sd->status.inventory[i].identify;
|
|
||||||
WBUFW(buf,n*10+10)=sd->status.inventory[i].amount;
|
|
||||||
if (sd->inventory_data[i]->equip == 0x8000) {
|
|
||||||
WBUFW(buf,n*10+12)=0x8000;
|
|
||||||
if (sd->status.inventory[i].equip)
|
|
||||||
arrow=i; // ついでに矢装備チェック
|
|
||||||
} else
|
|
||||||
WBUFW(buf,n*10+12)=0;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if (n) {
|
|
||||||
WBUFW(buf,2)=4+n*10;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
WBUFW(buf,0)=0x1ee;
|
WBUFW(buf,0)=0x1ee;
|
||||||
for(i=0,n=0;i<MAX_INVENTORY;i++){
|
#endif
|
||||||
if(sd->status.inventory[i].nameid <=0 || sd->inventory_data[i] == NULL || itemdb_isequip2(sd->inventory_data[i]))
|
WBUFW(buf,2)=4+n*s;
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*18+4)=i+2;
|
|
||||||
if(sd->inventory_data[i]->view_id > 0)
|
|
||||||
WBUFW(buf,n*18+6)=sd->inventory_data[i]->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*18+6)=sd->status.inventory[i].nameid;
|
|
||||||
WBUFB(buf,n*18+8)=itemtype(sd->inventory_data[i]->type);
|
|
||||||
WBUFB(buf,n*18+9)=sd->status.inventory[i].identify;
|
|
||||||
WBUFW(buf,n*18+10)=sd->status.inventory[i].amount;
|
|
||||||
if (sd->inventory_data[i]->equip == 0x8000) {
|
|
||||||
WBUFW(buf,n*18+12)=0x8000;
|
|
||||||
if(sd->status.inventory[i].equip)
|
|
||||||
arrow=i; // ついでに矢装備チェック
|
|
||||||
} else
|
|
||||||
WBUFW(buf,n*18+12)=0;
|
|
||||||
clif_addcards(WBUFP(buf, n*18+14), &sd->status.inventory[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if (n) {
|
|
||||||
WBUFW(buf,2)=4+n*18;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if(arrow >= 0)
|
if(arrow >= 0)
|
||||||
clif_arrowequip(sd,arrow);
|
clif_arrowequip(sd,arrow);
|
||||||
return 0;
|
|
||||||
|
if(ne){
|
||||||
|
WBUFW(bufe,0)=0xa4;
|
||||||
|
WBUFW(bufe,2)=4+ne*20;
|
||||||
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
}
|
||||||
*
|
|
||||||
*------------------------------------------
|
//Required when items break/get-repaired. Only sends equippable item list.
|
||||||
*/
|
void clif_equiplist(struct map_session_data *sd)
|
||||||
int clif_equiplist(struct map_session_data *sd)
|
|
||||||
{
|
{
|
||||||
int i,n,fd;
|
int i,n,fd = sd->fd;
|
||||||
|
unsigned char *buf;
|
||||||
|
WFIFOHEAD(fd, MAX_INVENTORY * 20 + 4);
|
||||||
|
buf = WFIFOP(fd,0);
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
|
|
||||||
fd=sd->fd;
|
|
||||||
if (!session_isActive(fd))
|
|
||||||
return 0;
|
|
||||||
WFIFOHEAD(fd, 4 + MAX_INVENTORY * 20);
|
|
||||||
WFIFOW(fd,0)=0xa4;
|
|
||||||
for(i=0,n=0;i<MAX_INVENTORY;i++){
|
for(i=0,n=0;i<MAX_INVENTORY;i++){
|
||||||
if(sd->status.inventory[i].nameid<=0 || sd->inventory_data[i] == NULL || !itemdb_isequip2(sd->inventory_data[i]))
|
if (sd->status.inventory[i].nameid <=0 || sd->inventory_data[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
WFIFOW(fd,n*20+4)=i+2;
|
|
||||||
if(sd->inventory_data[i]->view_id > 0)
|
if(!itemdb_isequip2(sd->inventory_data[i]))
|
||||||
WFIFOW(fd,n*20+6)=sd->inventory_data[i]->view_id;
|
continue;
|
||||||
else
|
//Equippable
|
||||||
WFIFOW(fd,n*20+6)=sd->status.inventory[i].nameid;
|
WBUFW(buf,n*20+4)=i+2;
|
||||||
WFIFOB(fd,n*20+8)=itemtype(sd->inventory_data[i]->type);
|
clif_item_sub(buf, n*20+6, &sd->status.inventory[i], sd->inventory_data[i], pc_equippoint(sd,i));
|
||||||
WFIFOB(fd,n*20+9)=sd->status.inventory[i].identify;
|
clif_addcards(WBUFP(buf, n*20+16), &sd->status.inventory[i]);
|
||||||
WFIFOW(fd,n*20+10)=pc_equippoint(sd,i);
|
|
||||||
WFIFOW(fd,n*20+12)=sd->status.inventory[i].equip;
|
|
||||||
WFIFOB(fd,n*20+14)=sd->status.inventory[i].attribute;
|
|
||||||
WFIFOB(fd,n*20+15)=sd->status.inventory[i].refine;
|
|
||||||
clif_addcards(WFIFOP(fd, n*20+16), &sd->status.inventory[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WFIFOW(fd,2)=4+n*20;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*==========================================
|
|
||||||
* カプラさんに預けてある消耗品&収集品リスト
|
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_storageitemlist(struct map_session_data *sd,struct storage *stor)
|
|
||||||
{
|
|
||||||
struct item_data *id;
|
|
||||||
int i,n,fd;
|
|
||||||
unsigned char *buf;
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
nullpo_retr(0, stor);
|
|
||||||
|
|
||||||
fd=sd->fd;
|
|
||||||
WFIFOHEAD(fd,MAX_STORAGE * 18 + 4);
|
|
||||||
buf = WFIFOP(fd,0);
|
|
||||||
#if PACKETVER < 5
|
|
||||||
WBUFW(buf,0)=0xa5;
|
|
||||||
for(i=0,n=0;i<MAX_STORAGE;i++){
|
|
||||||
if(stor->storage_[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
WBUFW(buf,n*10+4)=i+1;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*10+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*10+6)=stor->storage_[i].nameid;
|
|
||||||
WBUFB(buf,n*10+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*10+9)=stor->storage_[i].identify;
|
|
||||||
WBUFW(buf,n*10+10)=stor->storage_[i].amount;
|
|
||||||
WBUFW(buf,n*10+12)=0;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,2)=4+n*10;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
WBUFW(buf,0)=0x1f0;
|
|
||||||
for(i=0,n=0;i<MAX_STORAGE;i++){
|
|
||||||
if(stor->storage_[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
WBUFW(buf,n*18+4)=i+1;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*18+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*18+6)=stor->storage_[i].nameid;
|
|
||||||
WBUFB(buf,n*18+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*18+9)=stor->storage_[i].identify;
|
|
||||||
WBUFW(buf,n*18+10)=stor->storage_[i].amount;
|
|
||||||
WBUFW(buf,n*18+12)=0;
|
|
||||||
clif_addcards(WBUFP(buf,n*18+14), &stor->storage_[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,2)=4+n*18;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*==========================================
|
|
||||||
* カプラさんに預けてある装備リスト
|
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_storageequiplist(struct map_session_data *sd,struct storage *stor)
|
|
||||||
{
|
|
||||||
struct item_data *id;
|
|
||||||
int i,n,fd;
|
|
||||||
unsigned char *buf;
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
nullpo_retr(0, stor);
|
|
||||||
|
|
||||||
fd=sd->fd;
|
|
||||||
WFIFOHEAD(fd,MAX_STORAGE * 20 + 4);
|
|
||||||
buf = WFIFOP(fd,0);
|
|
||||||
WBUFW(buf,0)=0xa6;
|
|
||||||
for(i=0,n=0;i<MAX_STORAGE;i++){
|
|
||||||
if(stor->storage_[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
|
||||||
if(!itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*20+4)=i+1;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*20+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*20+6)=stor->storage_[i].nameid;
|
|
||||||
WBUFB(buf,n*20+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*20+9)=stor->storage_[i].identify;
|
|
||||||
WBUFW(buf,n*20+10)=id->equip;
|
|
||||||
WBUFW(buf,n*20+12)=stor->storage_[i].equip;
|
|
||||||
WBUFB(buf,n*20+14)=stor->storage_[i].attribute;
|
|
||||||
WBUFB(buf,n*20+15)=stor->storage_[i].refine;
|
|
||||||
clif_addcards(WBUFP(buf, n*20+16), &stor->storage_[i]);
|
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
if (n) {
|
if (n) {
|
||||||
|
WBUFW(buf,0)=0xa4;
|
||||||
WBUFW(buf,2)=4+n*20;
|
WBUFW(buf,2)=4+n*20;
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
//Unified storage function which sends all of the storage (requires two packets, one for equipable items and one for stackable ones. [Skotlex]
|
||||||
*
|
void clif_storagelist(struct map_session_data *sd,struct storage *stor)
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage *stor)
|
|
||||||
{
|
{
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
int i,n,fd;
|
int i,n,ne,fd=sd->fd;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
|
unsigned char bufe[MAX_STORAGE*20+4];
|
||||||
nullpo_retr(0, sd);
|
#if PACKETVER < 5
|
||||||
nullpo_retr(0, stor);
|
const int s = 10; //Entry size.
|
||||||
|
#else
|
||||||
fd=sd->fd;
|
const int s = 18;
|
||||||
WFIFOHEAD(fd, MAX_GUILD_STORAGE * 18 + 4);
|
#endif
|
||||||
|
WFIFOHEAD(fd,MAX_STORAGE * s + 4);
|
||||||
buf = WFIFOP(fd,0);
|
buf = WFIFOP(fd,0);
|
||||||
|
|
||||||
|
for(i=0,n=0;i<MAX_STORAGE;i++){
|
||||||
|
if(stor->storage_[i].nameid<=0)
|
||||||
|
continue;
|
||||||
|
id = itemdb_search(stor->storage_[i].nameid);
|
||||||
|
if(itemdb_isequip2(id))
|
||||||
|
{ //Equippable
|
||||||
|
WBUFW(bufe,ne*20+4)=i+1;
|
||||||
|
clif_item_sub(bufe, ne*20+6, &stor->storage_[i], id, id->equip);
|
||||||
|
clif_addcards(WBUFP(bufe, ne*20+16), &stor->storage_[i]);
|
||||||
|
ne++;
|
||||||
|
} else { //Stackable
|
||||||
|
WBUFW(buf,n*s+4)=i+1;
|
||||||
|
clif_item_sub(buf, n*s+6, &stor->storage_[i], id, 0);
|
||||||
|
#if PACKETVER >= 5
|
||||||
|
clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]);
|
||||||
|
#endif
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(n){
|
||||||
#if PACKETVER < 5
|
#if PACKETVER < 5
|
||||||
WBUFW(buf,0)=0xa5;
|
WBUFW(buf,0)=0xa5;
|
||||||
for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){
|
|
||||||
if(stor->storage_[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
WBUFW(buf,n*10+4)=i+1;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*10+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*10+6)=stor->storage_[i].nameid;
|
|
||||||
WBUFB(buf,n*10+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*10+9)=stor->storage_[i].identify;
|
|
||||||
WBUFW(buf,n*10+10)=stor->storage_[i].amount;
|
|
||||||
WBUFW(buf,n*10+12)=0;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,2)=4+n*10;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
WBUFW(buf,0)=0x1f0;
|
WBUFW(buf,0)=0x1f0;
|
||||||
for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){
|
#endif
|
||||||
if(stor->storage_[i].nameid<=0)
|
WBUFW(buf,2)=4+n*s;
|
||||||
continue;
|
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
WBUFW(buf,n*18+4)=i+1;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*18+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*18+6)=stor->storage_[i].nameid;
|
|
||||||
WBUFB(buf,n*18+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*18+9)=stor->storage_[i].identify;
|
|
||||||
WBUFW(buf,n*18+10)=stor->storage_[i].amount;
|
|
||||||
WBUFW(buf,n*18+12)=0;
|
|
||||||
clif_addcards(WBUFP(buf,n*18+14), &stor->storage_[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,2)=4+n*18;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
}
|
}
|
||||||
#endif
|
if(ne){
|
||||||
return 0;
|
WBUFW(bufe,0)=0xa6;
|
||||||
|
WBUFW(bufe,2)=4+ne*20;
|
||||||
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
//Unified storage function which sends all of the storage (requires two packets, one for equipable items and one for stackable ones. [Skotlex]
|
||||||
*
|
void clif_guildstoragelist(struct map_session_data *sd,struct guild_storage *stor)
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_guildstorageequiplist(struct map_session_data *sd,struct guild_storage *stor)
|
|
||||||
{
|
{
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
int i,n,fd;
|
int i,n,ne,fd=sd->fd;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
|
unsigned char bufe[MAX_GUILD_STORAGE*20+4];
|
||||||
nullpo_retr(0, sd);
|
#if PACKETVER < 5
|
||||||
|
const int s = 10; //Entry size.
|
||||||
fd=sd->fd;
|
#else
|
||||||
WFIFOHEAD(fd, MAX_GUILD_STORAGE * 20 + 4);
|
const int s = 18;
|
||||||
|
#endif
|
||||||
|
WFIFOHEAD(fd,MAX_GUILD_STORAGE * s + 4);
|
||||||
buf = WFIFOP(fd,0);
|
buf = WFIFOP(fd,0);
|
||||||
|
|
||||||
WBUFW(buf,0)=0xa6;
|
|
||||||
for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){
|
for(i=0,n=0;i<MAX_GUILD_STORAGE;i++){
|
||||||
if(stor->storage_[i].nameid<=0)
|
if(stor->storage_[i].nameid<=0)
|
||||||
continue;
|
continue;
|
||||||
nullpo_retr(0, id = itemdb_search(stor->storage_[i].nameid));
|
id = itemdb_search(stor->storage_[i].nameid);
|
||||||
if(!itemdb_isequip2(id))
|
if(itemdb_isequip2(id))
|
||||||
continue;
|
{ //Equippable
|
||||||
WBUFW(buf,n*20+4)=i+1;
|
WBUFW(bufe,ne*20+4)=i+1;
|
||||||
if(id->view_id > 0)
|
clif_item_sub(bufe, ne*20+6, &stor->storage_[i], id, id->equip);
|
||||||
WBUFW(buf,n*20+6)=id->view_id;
|
clif_addcards(WBUFP(bufe, ne*20+16), &stor->storage_[i]);
|
||||||
else
|
ne++;
|
||||||
WBUFW(buf,n*20+6)=stor->storage_[i].nameid;
|
} else { //Stackable
|
||||||
WBUFB(buf,n*20+8)=itemtype(id->type);
|
WBUFW(buf,n*s+4)=i+1;
|
||||||
WBUFB(buf,n*20+9)=stor->storage_[i].identify;
|
clif_item_sub(buf, n*s+6, &stor->storage_[i], id, 0);
|
||||||
WBUFW(buf,n*20+10)=id->equip;
|
#if PACKETVER >= 5
|
||||||
WBUFW(buf,n*20+12)=stor->storage_[i].equip;
|
clif_addcards(WBUFP(buf,n*s+14), &stor->storage_[i]);
|
||||||
WBUFB(buf,n*20+14)=stor->storage_[i].attribute;
|
#endif
|
||||||
WBUFB(buf,n*20+15)=stor->storage_[i].refine;
|
|
||||||
clif_addcards(WBUFP(buf, n*20+16), &stor->storage_[i]);
|
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(n){
|
if(n){
|
||||||
WBUFW(buf,2)=4+n*20;
|
#if PACKETVER < 5
|
||||||
|
WBUFW(buf,0)=0xa5;
|
||||||
|
#else
|
||||||
|
WBUFW(buf,0)=0x1f0;
|
||||||
|
#endif
|
||||||
|
WBUFW(buf,2)=4+n*s;
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
}
|
}
|
||||||
return 0;
|
if(ne){
|
||||||
|
WBUFW(bufe,0)=0xa6;
|
||||||
|
WBUFW(bufe,2)=4+ne*20;
|
||||||
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void clif_cartlist(struct map_session_data *sd)
|
||||||
|
{
|
||||||
|
struct item_data *id;
|
||||||
|
int i,n,ne,fd=sd->fd;
|
||||||
|
unsigned char *buf;
|
||||||
|
unsigned char bufe[MAX_CART*20+4];
|
||||||
|
#if PACKETVER < 5
|
||||||
|
const int s = 10; //Entry size.
|
||||||
|
#else
|
||||||
|
const int s = 18;
|
||||||
|
#endif
|
||||||
|
WFIFOHEAD(fd, MAX_CART * s + 4);
|
||||||
|
buf = WFIFOP(fd,0);
|
||||||
|
|
||||||
|
for(i=0,n=0,ne=0;i<MAX_CART;i++){
|
||||||
|
if(sd->status.cart[i].nameid<=0)
|
||||||
|
continue;
|
||||||
|
id = itemdb_search(sd->status.cart[i].nameid);
|
||||||
|
if(itemdb_isequip2(id))
|
||||||
|
{ //Equippable
|
||||||
|
WBUFW(bufe,ne*20+4)=i+2;
|
||||||
|
clif_item_sub(bufe, ne*20+6, &sd->status.cart[i], id, id->equip);
|
||||||
|
clif_addcards(WBUFP(bufe, ne*20+16), &sd->status.cart[i]);
|
||||||
|
ne++;
|
||||||
|
} else { //Stackable
|
||||||
|
WBUFW(buf,n*s+4)=i+2;
|
||||||
|
clif_item_sub(buf, n*s+6, &sd->status.cart[i], id, 0);
|
||||||
|
#if PACKETVER >= 5
|
||||||
|
clif_addcards(WBUFP(buf,n*s+14), &sd->status.cart[i]);
|
||||||
|
#endif
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(n){
|
||||||
|
#if PACKETVER < 5
|
||||||
|
WBUFW(buf,0)=0x123;
|
||||||
|
#else
|
||||||
|
WBUFW(buf,0)=0x1ef;
|
||||||
|
#endif
|
||||||
|
WBUFW(buf,2)=4+n*s;
|
||||||
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
|
}
|
||||||
|
if(ne){
|
||||||
|
WBUFW(bufe,0)=0x122;
|
||||||
|
WBUFW(bufe,2)=4+ne*20;
|
||||||
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Guild XY locators [Valaris]
|
// Guild XY locators [Valaris]
|
||||||
@ -5532,116 +5454,6 @@ int clif_cart_delitem(struct map_session_data *sd,int n,int amount)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
|
||||||
* カートのアイテムリスト
|
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_cart_itemlist(struct map_session_data *sd)
|
|
||||||
{
|
|
||||||
struct item_data *id;
|
|
||||||
int i,n,fd;
|
|
||||||
unsigned char *buf;
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
|
|
||||||
fd=sd->fd;
|
|
||||||
WFIFOHEAD(fd, MAX_CART * 18 + 4);
|
|
||||||
buf = WFIFOP(fd,0);
|
|
||||||
#if PACKETVER < 5
|
|
||||||
for(i=0,n=0;i<MAX_CART;i++){
|
|
||||||
if(sd->status.cart[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
id = itemdb_search(sd->status.cart[i].nameid);
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*10+4)=i+2;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*10+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*10+6)=sd->status.cart[i].nameid;
|
|
||||||
WBUFB(buf,n*10+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*10+9)=sd->status.cart[i].identify;
|
|
||||||
WBUFW(buf,n*10+10)=sd->status.cart[i].amount;
|
|
||||||
WBUFW(buf,n*10+12)=0;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,0)=0x123;
|
|
||||||
WBUFW(buf,2)=4+n*10;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
for(i=0,n=0;i<MAX_CART;i++){
|
|
||||||
if(sd->status.cart[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
id = itemdb_search(sd->status.cart[i].nameid);
|
|
||||||
if(itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*18+4)=i+2;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*18+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*18+6)=sd->status.cart[i].nameid;
|
|
||||||
WBUFB(buf,n*18+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*18+9)=sd->status.cart[i].identify;
|
|
||||||
WBUFW(buf,n*18+10)=sd->status.cart[i].amount;
|
|
||||||
WBUFW(buf,n*18+12)=0; //Here goes the equip location, which seems unnecessary to fill for the cart data.
|
|
||||||
clif_addcards(WBUFP(buf,n*18+14), &sd->status.cart[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,0)=0x1ef;
|
|
||||||
WBUFW(buf,2)=4+n*18;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*==========================================
|
|
||||||
* カートの装備品リスト
|
|
||||||
*------------------------------------------
|
|
||||||
*/
|
|
||||||
int clif_cart_equiplist(struct map_session_data *sd)
|
|
||||||
{
|
|
||||||
struct item_data *id;
|
|
||||||
int i,n,fd;
|
|
||||||
unsigned char *buf;
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
|
||||||
|
|
||||||
fd=sd->fd;
|
|
||||||
WFIFOHEAD(fd, MAX_INVENTORY * 20 + 4);
|
|
||||||
buf = WFIFOP(fd,0);
|
|
||||||
|
|
||||||
for(i=0,n=0;i<MAX_INVENTORY;i++){
|
|
||||||
if(sd->status.cart[i].nameid<=0)
|
|
||||||
continue;
|
|
||||||
id = itemdb_search(sd->status.cart[i].nameid);
|
|
||||||
if(!itemdb_isequip2(id))
|
|
||||||
continue;
|
|
||||||
WBUFW(buf,n*20+4)=i+2;
|
|
||||||
if(id->view_id > 0)
|
|
||||||
WBUFW(buf,n*20+6)=id->view_id;
|
|
||||||
else
|
|
||||||
WBUFW(buf,n*20+6)=sd->status.cart[i].nameid;
|
|
||||||
WBUFB(buf,n*20+8)=itemtype(id->type);
|
|
||||||
WBUFB(buf,n*20+9)=sd->status.cart[i].identify;
|
|
||||||
WBUFW(buf,n*20+10)=id->equip;
|
|
||||||
WBUFW(buf,n*20+12)=sd->status.cart[i].equip;
|
|
||||||
WBUFB(buf,n*20+14)=sd->status.cart[i].attribute;
|
|
||||||
WBUFB(buf,n*20+15)=sd->status.cart[i].refine;
|
|
||||||
clif_addcards(WBUFP(buf, n*20+16), &sd->status.cart[i]);
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
if(n){
|
|
||||||
WBUFW(buf,0)=0x122;
|
|
||||||
WBUFW(buf,2)=4+n*20;
|
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ˜I“XŠJ<EFBFBD>Ý
|
* ˜I“XŠJ<EFBFBD>Ý
|
||||||
*------------------------------------------
|
*------------------------------------------
|
||||||
@ -8188,13 +8000,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
|
|
||||||
// item
|
// item
|
||||||
pc_checkitem(sd);
|
pc_checkitem(sd);
|
||||||
clif_itemlist(sd);
|
clif_inventorylist(sd);
|
||||||
clif_equiplist(sd);
|
|
||||||
|
|
||||||
// cart
|
// cart
|
||||||
if(pc_iscarton(sd)){
|
if(pc_iscarton(sd)){
|
||||||
clif_cart_itemlist(sd);
|
clif_cartlist(sd);
|
||||||
clif_cart_equiplist(sd);
|
|
||||||
clif_updatestatus(sd,SP_CARTINFO);
|
clif_updatestatus(sd,SP_CARTINFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,14 +155,12 @@ int clif_tradecompleted(struct map_session_data *sd,int fail);
|
|||||||
|
|
||||||
// storage
|
// storage
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
int clif_storageitemlist(struct map_session_data *sd,struct storage *stor);
|
void clif_storagelist(struct map_session_data *sd,struct storage *stor);
|
||||||
int clif_storageequiplist(struct map_session_data *sd,struct storage *stor);
|
|
||||||
int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor);
|
int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor);
|
||||||
int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int index,int amount);
|
int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int index,int amount);
|
||||||
int clif_storageitemremoved(struct map_session_data *sd,int index,int amount);
|
int clif_storageitemremoved(struct map_session_data *sd,int index,int amount);
|
||||||
int clif_storageclose(struct map_session_data *sd);
|
int clif_storageclose(struct map_session_data *sd);
|
||||||
int clif_guildstorageitemlist(struct map_session_data *sd,struct guild_storage *stor);
|
void clif_guildstoragelist(struct map_session_data *sd,struct guild_storage *stor);
|
||||||
int clif_guildstorageequiplist(struct map_session_data *sd,struct guild_storage *stor);
|
|
||||||
int clif_updateguildstorageamount(struct map_session_data *sd,struct guild_storage *stor);
|
int clif_updateguildstorageamount(struct map_session_data *sd,struct guild_storage *stor);
|
||||||
int clif_guildstorageitemadded(struct map_session_data *sd,struct guild_storage *stor,int index,int amount);
|
int clif_guildstorageitemadded(struct map_session_data *sd,struct guild_storage *stor,int index,int amount);
|
||||||
|
|
||||||
@ -226,13 +224,12 @@ int clif_charnameupdate(struct map_session_data *ssd);
|
|||||||
int clif_use_card(struct map_session_data *sd,int idx);
|
int clif_use_card(struct map_session_data *sd,int idx);
|
||||||
int clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
|
int clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
|
||||||
|
|
||||||
int clif_itemlist(struct map_session_data *sd);
|
void clif_inventorylist(struct map_session_data *sd);
|
||||||
int clif_equiplist(struct map_session_data *sd);
|
void clif_equiplist(struct map_session_data *sd);
|
||||||
|
|
||||||
int clif_cart_additem(struct map_session_data*,int,int,int);
|
int clif_cart_additem(struct map_session_data*,int,int,int);
|
||||||
int clif_cart_delitem(struct map_session_data*,int,int);
|
int clif_cart_delitem(struct map_session_data*,int,int);
|
||||||
int clif_cart_itemlist(struct map_session_data *sd);
|
void clif_cartlist(struct map_session_data *sd);
|
||||||
int clif_cart_equiplist(struct map_session_data *sd);
|
|
||||||
|
|
||||||
int clif_item_identify_list(struct map_session_data *sd);
|
int clif_item_identify_list(struct map_session_data *sd);
|
||||||
int clif_item_identified(struct map_session_data *sd,int idx,int flag);
|
int clif_item_identified(struct map_session_data *sd,int idx,int flag);
|
||||||
|
@ -1410,11 +1410,16 @@ int guild_opposition(struct map_session_data *sd,int char_id)
|
|||||||
if(g->alliance[i].opposition==1){ // すでに敵対
|
if(g->alliance[i].opposition==1){ // すでに敵対
|
||||||
clif_guild_oppositionack(sd,2);
|
clif_guild_oppositionack(sd,2);
|
||||||
return 0;
|
return 0;
|
||||||
}else // “¯–¿”jŠü
|
} else { //Change alliance to opposition.
|
||||||
|
if(agit_flag) {
|
||||||
|
clif_displaymessage(sd->fd,"You cannot break an alliance during Guild Wars!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
|
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
|
||||||
sd->status.account_id,tsd->status.account_id,8 );
|
sd->status.account_id,tsd->status.account_id,8 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// inter鯖に敵対要請
|
// inter鯖に敵対要請
|
||||||
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
|
intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
|
||||||
|
@ -952,8 +952,7 @@ int intif_parse_LoadStorage(int fd) {
|
|||||||
stor->dirty=0;
|
stor->dirty=0;
|
||||||
stor->storage_status=1;
|
stor->storage_status=1;
|
||||||
sd->state.storage_flag = 1;
|
sd->state.storage_flag = 1;
|
||||||
clif_storageitemlist(sd,stor);
|
clif_storagelist(sd,stor);
|
||||||
clif_storageequiplist(sd,stor);
|
|
||||||
clif_updatestorageamount(sd,stor);
|
clif_updatestorageamount(sd,stor);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1011,8 +1010,7 @@ int intif_parse_LoadGuildStorage(int fd)
|
|||||||
memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
|
memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
|
||||||
gstor->storage_status = 1;
|
gstor->storage_status = 1;
|
||||||
sd->state.storage_flag = 2;
|
sd->state.storage_flag = 2;
|
||||||
clif_guildstorageitemlist(sd,gstor);
|
clif_guildstoragelist(sd,gstor);
|
||||||
clif_guildstorageequiplist(sd,gstor);
|
|
||||||
clif_updateguildstorageamount(sd,gstor);
|
clif_updateguildstorageamount(sd,gstor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -263,15 +263,30 @@ int itemdb_isequip(int nameid)
|
|||||||
*/
|
*/
|
||||||
int itemdb_isequip2(struct item_data *data)
|
int itemdb_isequip2(struct item_data *data)
|
||||||
{
|
{
|
||||||
if(data) {
|
nullpo_retr(0, data);
|
||||||
int type=data->type;
|
switch(data->type) {
|
||||||
if(type==0 || type==2 || type==3 || type==6 || type==10)
|
case 0:
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 6:
|
||||||
|
case 10:
|
||||||
return 0;
|
return 0;
|
||||||
else
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//Checks if the item is pet-equipment (7/8)
|
||||||
|
static int itemdb_ispetequip(struct item_data *data)
|
||||||
|
{
|
||||||
|
switch(data->type) {
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Trade Restriction functions [Skotlex]
|
* Trade Restriction functions [Skotlex]
|
||||||
@ -584,7 +599,7 @@ static int itemdb_read_itemslottable(void)
|
|||||||
struct item_data* item;
|
struct item_data* item;
|
||||||
sscanf(p, "%d#%d#", &nameid, &equip);
|
sscanf(p, "%d#%d#", &nameid, &equip);
|
||||||
item = itemdb_search(nameid);
|
item = itemdb_search(nameid);
|
||||||
if (item && itemdb_isequip2(item))
|
if (equip && item && itemdb_isequip2(item))
|
||||||
item->equip = equip;
|
item->equip = equip;
|
||||||
p = strchr(p, 10);
|
p = strchr(p, 10);
|
||||||
if(!p) break;
|
if(!p) break;
|
||||||
@ -852,6 +867,11 @@ static int itemdb_read_sqldb(void)
|
|||||||
id->class_upper= (sql_row[12] != NULL) ? atoi(sql_row[12]) : 0;
|
id->class_upper= (sql_row[12] != NULL) ? atoi(sql_row[12]) : 0;
|
||||||
id->sex = (sql_row[13] != NULL) ? atoi(sql_row[13]) : 0;
|
id->sex = (sql_row[13] != NULL) ? atoi(sql_row[13]) : 0;
|
||||||
id->equip = (sql_row[14] != NULL) ? atoi(sql_row[14]) : 0;
|
id->equip = (sql_row[14] != NULL) ? atoi(sql_row[14]) : 0;
|
||||||
|
if (!id->equip && itemdb_isequip2(id) && !itemdb_ispetequip(id))
|
||||||
|
{
|
||||||
|
ShowWarning("Item %d (%s) is an equipment with no equip-field! Making it an etc item.\n", nameid, id->jname);
|
||||||
|
id->type = 3;
|
||||||
|
}
|
||||||
id->wlv = (sql_row[15] != NULL) ? atoi(sql_row[15]) : 0;
|
id->wlv = (sql_row[15] != NULL) ? atoi(sql_row[15]) : 0;
|
||||||
id->elv = (sql_row[16] != NULL) ? atoi(sql_row[16]) : 0;
|
id->elv = (sql_row[16] != NULL) ? atoi(sql_row[16]) : 0;
|
||||||
id->flag.no_refine = (sql_row[17] == NULL || atoi(sql_row[17]) == 1)?0:1;
|
id->flag.no_refine = (sql_row[17] == NULL || atoi(sql_row[17]) == 1)?0:1;
|
||||||
@ -1019,6 +1039,11 @@ static int itemdb_readdb(void)
|
|||||||
if(id->equip != atoi(str[14])){
|
if(id->equip != atoi(str[14])){
|
||||||
id->equip=atoi(str[14]);
|
id->equip=atoi(str[14]);
|
||||||
}
|
}
|
||||||
|
if (!id->equip && itemdb_isequip2(id) && !itemdb_ispetequip(id))
|
||||||
|
{
|
||||||
|
ShowWarning("Item %d (%s) is an equipment with no equip-field! Making it an etc item.\n", nameid, id->jname);
|
||||||
|
id->type = 3;
|
||||||
|
}
|
||||||
id->wlv=atoi(str[15]);
|
id->wlv=atoi(str[15]);
|
||||||
id->elv=atoi(str[16]);
|
id->elv=atoi(str[16]);
|
||||||
id->flag.no_refine = atoi(str[17])?0:1; //If the refine column is 1, no_refine is 0
|
id->flag.no_refine = atoi(str[17])?0:1; //If the refine column is 1, no_refine is 0
|
||||||
|
@ -1048,9 +1048,9 @@ TBL_NPC *npc_checknear(struct map_session_data *sd,struct block_list *bl)
|
|||||||
if (bl->m!=sd->bl.m ||
|
if (bl->m!=sd->bl.m ||
|
||||||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
|
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
|
||||||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)
|
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)
|
||||||
return nd;
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
return nd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
|
@ -203,10 +203,10 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
|||||||
return -1;
|
return -1;
|
||||||
md=&map[m];
|
md=&map[m];
|
||||||
|
|
||||||
if(count>15){ // 最大10マスに制限
|
if(count>25){ //Cap to prevent too much processing...?
|
||||||
if(battle_config.error_log)
|
if(battle_config.error_log)
|
||||||
ShowWarning("path_blownpos: count too many %d !\n",count);
|
ShowWarning("path_blownpos: count too many %d !\n",count);
|
||||||
count=15;
|
count=25;
|
||||||
}
|
}
|
||||||
if(dx>1 || dx<-1 || dy>1 || dy<-1){
|
if(dx>1 || dx<-1 || dy>1 || dy<-1){
|
||||||
if(battle_config.error_log)
|
if(battle_config.error_log)
|
||||||
@ -215,7 +215,7 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
|||||||
dy=(dy>=0)?1:((dy<0)?-1:0);
|
dy=(dy>=0)?1:((dy<0)?-1:0);
|
||||||
}
|
}
|
||||||
|
|
||||||
while( (count--)>0 && (dx!=0 || dy!=0) ){
|
while( (count--)>0 && (dx || dy) ){
|
||||||
if( !can_move(md,x0,y0,x0+dx,y0+dy,0) ){
|
if( !can_move(md,x0,y0,x0+dx,y0+dy,0) ){
|
||||||
int fx=(dx!=0 && can_move(md,x0,y0,x0+dx,y0,0));
|
int fx=(dx!=0 && can_move(md,x0,y0,x0+dx,y0,0));
|
||||||
int fy=(dy!=0 && can_move(md,x0,y0,x0,y0+dy,0));
|
int fy=(dy!=0 && can_move(md,x0,y0,x0,y0+dy,0));
|
||||||
|
@ -385,7 +385,6 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
|
|||||||
int pc_equippoint(struct map_session_data *sd,int n)
|
int pc_equippoint(struct map_session_data *sd,int n)
|
||||||
{
|
{
|
||||||
int ep = 0;
|
int ep = 0;
|
||||||
//?生や養子の場合の元の職業を算出する
|
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
@ -4029,7 +4028,7 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
|
|||||||
|
|
||||||
clif_updatestatus(sd,SP_BASEEXP);
|
clif_updatestatus(sd,SP_BASEEXP);
|
||||||
|
|
||||||
if (job_exp > 0 && sd->status.job_exp > UINT_MAX - job_exp)
|
if (job_exp && sd->status.job_exp > UINT_MAX - job_exp)
|
||||||
sd->status.job_exp = UINT_MAX;
|
sd->status.job_exp = UINT_MAX;
|
||||||
else
|
else
|
||||||
sd->status.job_exp += job_exp;
|
sd->status.job_exp += job_exp;
|
||||||
@ -5340,7 +5339,6 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
|
|||||||
status_calc_pc(sd,0);
|
status_calc_pc(sd,0);
|
||||||
pc_checkallowskill(sd);
|
pc_checkallowskill(sd);
|
||||||
pc_equiplookall(sd);
|
pc_equiplookall(sd);
|
||||||
clif_equiplist(sd);
|
|
||||||
|
|
||||||
//if you were previously famous, not anymore.
|
//if you were previously famous, not anymore.
|
||||||
if (fame_flag) {
|
if (fame_flag) {
|
||||||
@ -5532,8 +5530,7 @@ int pc_setcart(struct map_session_data *sd,int type)
|
|||||||
option|=cart[type];
|
option|=cart[type];
|
||||||
if(!pc_iscarton(sd)){ // ƒJ?ƒg‚ð•t‚¯‚Ä‚¢‚È‚¢
|
if(!pc_iscarton(sd)){ // ƒJ?ƒg‚ð•t‚¯‚Ä‚¢‚È‚¢
|
||||||
pc_setoption(sd,option);
|
pc_setoption(sd,option);
|
||||||
clif_cart_itemlist(sd);
|
clif_cartlist(sd);
|
||||||
clif_cart_equiplist(sd);
|
|
||||||
clif_updatestatus(sd,SP_CARTINFO);
|
clif_updatestatus(sd,SP_CARTINFO);
|
||||||
clif_status_change(&sd->bl,SI_INCREASEAGI,0); //0x0c is 12, Increase Agi??
|
clif_status_change(&sd->bl,SI_INCREASEAGI,0); //0x0c is 12, Increase Agi??
|
||||||
}
|
}
|
||||||
|
@ -149,8 +149,7 @@ int storage_storageopen(struct map_session_data *sd)
|
|||||||
|
|
||||||
stor->storage_status = 1;
|
stor->storage_status = 1;
|
||||||
sd->state.storage_flag = 1;
|
sd->state.storage_flag = 1;
|
||||||
clif_storageitemlist(sd,stor);
|
clif_storagelist(sd,stor);
|
||||||
clif_storageequiplist(sd,stor);
|
|
||||||
clif_updatestorageamount(sd,stor);
|
clif_updatestorageamount(sd,stor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -476,8 +475,7 @@ int storage_guild_storageopen(struct map_session_data *sd)
|
|||||||
|
|
||||||
gstor->storage_status = 1;
|
gstor->storage_status = 1;
|
||||||
sd->state.storage_flag = 2;
|
sd->state.storage_flag = 2;
|
||||||
clif_guildstorageitemlist(sd,gstor);
|
clif_guildstoragelist(sd,gstor);
|
||||||
clif_guildstorageequiplist(sd,gstor);
|
|
||||||
clif_updateguildstorageamount(sd,gstor);
|
clif_updateguildstorageamount(sd,gstor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -815,7 +815,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
|
|||||||
case NPC_SUMMONSLAVE:
|
case NPC_SUMMONSLAVE:
|
||||||
case NPC_SUMMONMONSTER:
|
case NPC_SUMMONMONSTER:
|
||||||
case AL_TELEPORT:
|
case AL_TELEPORT:
|
||||||
if (((TBL_MOB*)src)->master_id)
|
if (((TBL_MOB*)src)->master_id && ((TBL_MOB*)src)->special_state.ai)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user