本文整理汇总了C++中NXWCLIENT::sendSpellBook方法的典型用法代码示例。如果您正苦于以下问题:C++ NXWCLIENT::sendSpellBook方法的具体用法?C++ NXWCLIENT::sendSpellBook怎么用?C++ NXWCLIENT::sendSpellBook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NXWCLIENT
的用法示例。
在下文中一共展示了NXWCLIENT::sendSpellBook方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doubleclick
//.........这里部分代码省略.........
case ITYPE_KEY:
targ = clientInfo[s]->newTarget( new cItemTarget() );
targ->code_callback = target_key;
targ->buffer[0]= pi->more1;
targ->buffer[1]= pi->more2;
targ->buffer[2]= pi->more3;
targ->buffer[3]= pi->more4;
targ->send( ps );
ps->sysmsg( TRANSLATE("Select item to use the key on."));
return;
case ITYPE_LOCKED_ITEM_SPAWNER:
case ITYPE_LOCKED_CONTAINER:
// Added traps effects by AntiChrist
// Wintermute: GMs or Counselors should be able to open locked containers always
if ( !pc->IsGMorCounselor() )
{
if (pi->moreb1 > 0 ) {
magic::castAreaAttackSpell(pi->getPosition().x, pi->getPosition().y, magic::SPELL_EXPLOSION);
pi->moreb1--;
}
pc->sysmsg(TRANSLATE("This item is locked."));
return;
}
else
{
pc->showContainer(pi);
return;
}
case ITYPE_SPELLBOOK:
if (ISVALIDPI(pack)) // morrolan
if(pi->getContSerial()==pack->getSerial32() || pc->IsWearing(pi))
ps->sendSpellBook(pi);
else
pc->sysmsg(TRANSLATE("If you wish to open a spellbook, it must be equipped or in your main backpack."));
return;
case ITYPE_MAP:
LongToCharPtr(pi->getSerial32(), map1 +1);
map2[1] = map1[1];
map2[2] = map1[2];
map2[3] = map1[3];
map2[4] = map1[4];
/*
By Polygon:
Assign areas and map size before sending
*/
map1[7] = pi->more1; // Assign topleft x
map1[8] = pi->more2;
map1[9] = pi->more3; // Assign topleft y
map1[10] = pi->more4;
map1[11] = pi->moreb1; // Assign lowright x
map1[12] = pi->moreb2;
map1[13] = pi->moreb3; // Assign lowright y
map1[14] = pi->moreb4;
int width, height; // Tempoary storage for w and h;
width = 134 + (134 * pi->morez); // Calculate new w and h
height = 134 + (134 * pi->morez);
ShortToCharPtr(width, map1 +15);
ShortToCharPtr(height, map1 +17);
// END OF: By Polygon
Xsend(s, map1, 19);
//AoS/ Network->FlushBuffer(s);
Xsend(s, map2, 11);
//AoS/ Network->FlushBuffer(s);
示例2: pack_item
//.........这里部分代码省略.........
}
if( strncmp(pItem->getCurrentNameC(), "#", 1) )
pItem->getName(temp2);
else
strcpy(temp2,pItem->getCurrentNameC());
NxwItemWrapper sii;
sii.fillItemsInContainer( pCont, false );
for( sii.rewind(); !sii.isEmpty(); sii++ ) {
P_ITEM pi_ci=sii.getItem();
if (ISVALIDPI(pi_ci))
{
if( strncmp(pi_ci->getCurrentNameC(), "#", 1) )
pi_ci->getName(temp);
else
strcpy(temp,pi_ci->getCurrentNameC());
if(!(strcmp(temp,temp2)) || !(strcmp(temp,"All-Spell Scroll")))
{
ps->sysmsg(TRANSLATE("You already have that spell!"));
item_bounce6(ps,pItem);
return;
}
}
// Juliunus, to prevent ppl from wasting scrolls.
if (pItem->amount > 1)
{
ps->sysmsg(TRANSLATE("You can't put more than one scroll at a time in your book."));
item_bounce6(ps,pItem);
return;
}
}
}
pCont->AddItem( pItem );
ps->sendSpellBook(pCont);
return;
}
if (pCont->type == ITYPE_CONTAINER) {
if ( ISVALIDPC(contOwner) )
{
if ( (contOwner->npcaitype==NPCAI_PLAYERVENDOR) && (contOwner->npc) && (contOwner->getOwnerSerial32()==pc->getSerial32()) )
{
pc->fx1= DEREF_P_ITEM(pItem);
pc->fx2=17;
pc->sysmsg(TRANSLATE("Set a price for this item."));
}
}
short xx=pp->TxLoc;
short yy=pp->TyLoc;
pCont->AddItem(pItem,xx,yy);
pc->playSFX( itemsfx(pItem->getId()) );
statwindow(pc,pc);
}
// end of player run vendors
else
// - Unlocked item spawner or unlockable item spawner
if (pCont->type==ITYPE_UNLOCKED_CONTAINER || pCont->type==ITYPE_NODECAY_ITEM_SPAWNER || pCont->type==ITYPE_DECAYING_ITEM_SPAWNER)
{
pCont->AddItem(pItem, pp->TxLoc, pp->TyLoc); //Luxor
pc->playSFX( itemsfx(pItem->getId()) );
}
else // - Pileable
if (pCont->pileable && pItem->pileable)
{
if ( !pCont->PileItem( pItem ) )
{
item_bounce6(ps,pItem);
return;
}
}
else
{
if( pItem->getContSerial( true )==INVALID ) //current cont serial is invalid because is dragging
{
NxwSocketWrapper sw;
sw.fillOnline( pItem->getPosition() );
for( sw.rewind(); !sw.isEmpty(); sw++ )
SendDeleteObjectPkt(sw.getSocket(), pItem->getSerial32() );
mapRegions->remove(pItem);
}
pItem->setPosition( pp->TxLoc, pp->TyLoc, pp->TzLoc);
pItem->setContSerial( pCont->getContSerial() );
pItem->Refresh();
}
}