• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature Conjure Runes Backpkac

adric21

Member
Joined
Apr 26, 2016
Messages
212
Best answers
1
Reaction score
19
Code:
Item* Player::getEquippedItem(slots_t slot) const
{
Item* item = getInventoryItem(slot);
if(!item)
return NULL;

switch(slot)
{
case SLOT_LEFT:
case SLOT_RIGHT:
return item->getWieldPosition() == SLOT_HAND ? item : NULL;

default:
break;
}

return item->getWieldPosition() == slot ? item : NULL;
}

-----------------------------ADD----------------------

Item* Player::getFirstItemById(uint32_t id) const
{
Item* tmpItem = NULL;
Container* tmpContainer = NULL;
std::list<Container*> listContainer;
for(int32_t slot = SLOT_FIRST; slot <= SLOT_LAST; slot++){
if((tmpItem = getInventoryItem((slots_t)slot))){
if(tmpItem->getID() == id){
return tmpItem;
}
else if((tmpContainer = tmpItem->getContainer())){
listContainer.push_back(tmpContainer);
}
}
}

ItemList::const_iterator it;
while(!listContainer.empty()){
Container* container = listContainer.front();
listContainer.pop_front();
for(it = container->getItems(); it != container->getEnd(); ++it){
if((tmpItem = *it)){
if(tmpItem->getID() == id){
return tmpItem;
}
else if((tmpContainer = tmpItem->getContainer())){
listContainer.push_back(tmpContainer);
}
}
}
}

return NULL;
}

_________________________________________________________________________

IN SPELLS.CPP CHAGE

if(!(item = player->getInventoryItem((slots_t)i)))

--------------TO-------------

if(!(item = player->getFirstItemById((uint32_t)i)))
_________________________________________________________________________

IN PLAYER.H

under

Item* getInventoryItem(slots_t slot) const;

----------------add--------------

Item* Player::getFirstItemById(uint32_t id) const;
 

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
456
Best answers
2
Reaction score
23
Location
México
can you please be more specific on how to install this feature?
 
Top